I know, I know, one is client side and one is server side. I had to use PHP to grab a few arrays of data and I'm passing this data in to Google Charts geomaps. E.g:
echo 'var data = google.visualization.arrayToDataTable([
["Country", "Popularity"],
';
foreach($countries as $key=>$val){
echo '["'.$key.'",'.$val.'],';
}
echo ']);
When a user clicks on one of the countries (using an event listener) on the map it puts this value into a variable:
var country = data.getValue(selectedItem.row, 0);
Now I need to pass this to the PHP array, so I can do something like:
if($country == country){
//do whatever
}
<script></script>tags when using JavaScript, however I doubt that will fix it.$country == country. Instead, make yourself familiar with AJAX and JSON. Google for these terms and find that intro suitable for you.