When calling a PHP function (which returns array) from Javascript I can't seem to view it.
The message I get is
function Array() { [native code] }
How can I access items within the array.
When I use alert(padd[0]);
the message returns undefined.
<?php
function getArray()
{
$cars = array("Volvo", "BMW", "Toyota");
return $cars;
}
?>
<script type="text/javascript">
function phpadd()
{
var padd = <?php echo getArray();?>;
alert(padd);
}
</script>