unless you were using something like AJAX to make a call back to the server, then you would have to print the PHP array to javascript.
if you had php_json installed on your system, it would be as easy as this:
<?
$myarray = array(1,2,3,4,5,6,7,8,9,0);
?>
<script language="text/javascript">
var jsarray = new Array();
jsarray = eval(<?=json_encode($myarray)?>);
</script>