Re: [PHP] Copying PHP array into a Javascript array

2007-04-10 Thread Paul Novitski
At 4/10/2007 01:36 PM, Otto Wyss wrote: I've an array of file names $files = getFiles ($d); but would like to use this array in a JavaScript array. How can I copy this $files into a JavaScript variable? As I'm sure you know, you can't literally copy the values from PHP into the javascrip

RE: [PHP] Copying PHP array into a Javascript array

2007-04-10 Thread Peter Lauri
: Tuesday, April 10, 2007 10:37 PM > To: php-general@lists.php.net > Subject: [PHP] Copying PHP array into a Javascript array > > I don't know if I should ask this question here or in the JavaScript > group. I'll try it here since people usually are more helpful. > > I&

Re: [PHP] Copying PHP array into a Javascript array

2007-04-10 Thread Otto Wyss
Jochem Maas wrote: // if you have this available: http://php.net/manual/en/function.json-encode.php echo json_encode($files); I thought there might be a solution with Json but couldn't locate it. I prefer it versus the iteration, thanks. Sometimes solutions are so simple if one knows them. O

Re: [PHP] Copying PHP array into a Javascript array

2007-04-10 Thread Jochem Maas
Otto Wyss wrote: > I don't know if I should ask this question here or in the JavaScript > group. I'll try it here since people usually are more helpful. > > I've an array of file names > > $files = getFiles ($d); > > but would like to use this array in a JavaScript array. How can I copy > this

RE: [PHP] Copying PHP array into a Javascript array

2007-04-10 Thread Buesching, Logan J
} ?> Although it looks nasty, I believe it could be a quick hack. -Original Message- From: Otto Wyss [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 10, 2007 4:37 PM To: php-general@lists.php.net Subject: [PHP] Copying PHP array into a Javascript array I don't kno

[PHP] Copying PHP array into a Javascript array

2007-04-10 Thread Otto Wyss
I don't know if I should ask this question here or in the JavaScript group. I'll try it here since people usually are more helpful. I've an array of file names $files = getFiles ($d); but would like to use this array in a JavaScript array. How can I copy this $files into a JavaScript variab