Hi

To Assign values from an array in PHP to JavaScript,
you could try something like this.

$Array = array( 'one', 'two', 'three' );

Now in your JavaScript:

<SCRIPT LANGUAGE="JavaScript">

JSArray = new Array(<?= sizeof( $Array )?>);
<?php
for ( $iSubscript = 0; $iSubscript < sizeof( $Array ); $iSubscript++ )
{
        // Add each member of the php array to the JS array
        echo 'JSArray['.$iSubscript.'] = "'.$Array[$iSubscript].'";';
}
?>

</SCRIPT>

Regards

-|Scott


> -----Original Message-----
> From: kale [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 05, 2002 1:12 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Array Javascript 
> 
> 
> Hy,
> I have an array make with a javascript. 
> How can I read values with PHP from it?
> Kale.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to