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