I want to call a javascript function from my PHP code. I have achieved this by using:
echo '<script type="text/javascript"> drawChart($id); </script>';
This works fine, but I want to get data from my PHP code, which I did using the following:
var t_array = ?php echo json_encode($t_array); ?>;
(Yes, I know there's a > missing.) I think the PHP closing tag is interfering with the rest of the code. So now my question: How can I get PHP data without using the PHP tags?
Thanks in advance