Hi there....
There are lots of way that a PHP script can pass arrays to JavaScript...
you can output the array to javascript like:
$fls is an array.
<script>
rnd_imagesnames = new Array(
<?
for ($i = 0; $i < $count; $i++)
{
echo "'" . $fls[$i] . "'";
if ($i != $count - 1)
echo ",";
}
?>); // array statment closing
</script>
that's an example...
take a look at the 'rndimg' example using PHP & JavaScript...
-elias
http://ww.eassoft.cjb.net
""Reuben D Budiardja"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello,
I have a question here. Can I pass an Array (php) to a javascript
function, and then process the array there using javascript? How do I
access the php array in javascript then?
Say, all I want a do is to iterate through the array and build a string
using javascript, for example.
How do I pass the array to the javascript function? If someone could help
me, I would really appreciate it.
Thanks in advance.
Reuben D. Budiardja
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]