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
Check www.php.net/json You can use the encode function there. Best regards, Peter Lauri www.dwsasia.com - company web site www.lauri.se - personal web site www.carbonfree.org.uk - become Carbon Free > -Original Message- > From: Otto Wyss [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April

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
Something along the lines of the following: var myArray=new Array(); $val) { ?> myArray[]=""; Although it lo