Page 1 of 1

Assign a PHP Array to a Javascript Array?

Posted: Sat Nov 09, 2002 10:55 pm
by imroue
Is it possible to assign values of a PHP array dynamically to a Javascript Array?
:?: :?: :?:

If so, how?

Posted: Sun Nov 10, 2002 12:46 am
by Oleg Butuzov

Code: Select all

<?

$1img="1.gif";
$2img="2.gif";




echo "<script language=\"JavaScript\">
imgName = new Array()
imgName[0] = \"$1img\"
imgName[1] = \"$2img\"
</script>
";
?>