Nashirak is right. But he didn't tell you how to do it, and I'm thinking thats what you wanted.
you just have to loop through the PHP array and print it out as HTML/javascript.
<? php
Print ("
<script language="JavaScript">
var array_cd_var =
new Array(");
$myarray=array("1", "2", "3", "4", "5", "7", "8");
$i=0;
while (list($k,$v) = each($myarray)) {
print ("\"$v\"");
$i++;
if ($i<>count($myarray)) print (", ");
}
print (");
</script> ");
?>
or something like that. ;-)