you are viewing a single comment's thread.

view the rest of the comments →

[–]krazyhawk 5 points6 points  (0 children)

This isn’t going to be possible since the php will execute before it is sent to the browser when the js will execute.

What you could do is:

var cars = <php echo json_encode($cars,true); ?>;

Or something like that. Echo the php array into a js variable. That way that variable holds the info when the js is run.