how to pass php array to javascript function?
by Ramya[ Edit ] 2014-01-08 17:36:33
how to pass php array to javascript function?
In normal cases, we can't pass php array to javascript function with the exact value. In such cases, we can use json concept as,
echo '<li onclick="func('.json_encode($pushNo).')">'.$i.'<s/li>';
which you can retrieve as,
var temp = pushNo;
temp = pushNo.split('~');
for(i=0;i
{
alert(temp[i]);
}