Assign a PHP Array to a Javascript Array?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am

Assign a PHP Array to a Javascript Array?

Post by imroue » Sat Nov 09, 2002 10:55 pm

Is it possible to assign values of a PHP array dynamically to a Javascript Array?
:?: :?: :?:

If so, how?

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

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

Code: Select all

<?

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




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

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 6 guests