PHP array to javascript Array
Posted: Tue Jan 19, 2010 5:12 am
Can any body tell me simple two lines code for converting PHP array to javascript array.
$arr=array("a","b","c");
I have to pass array as argument like onclick="myFunction('<? echo $arr;?>')".
<script language="javascript">
function myFunction(jsArray)
{
I want to show "a","b","c" here.
}
</script>
Can any body tell me how should i do?
$arr=array("a","b","c");
I have to pass array as argument like onclick="myFunction('<? echo $arr;?>')".
<script language="javascript">
function myFunction(jsArray)
{
I want to show "a","b","c" here.
}
</script>
Can any body tell me how should i do?