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
: 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&
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
}
?>
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
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
6 matches
Mail list logo