<script type="text/javascript">
var places = [];
</script>
<?php
$date = $_POST['orderdate'];
$file = fopen("http://www.spc.noaa.gov/climo/reports/".$date."_rpts_hail.csv", "r");
$content = fgetcsv($file, 1000, ",");
$id = 1;
while (($content = fgetcsv($file, 1000, ",")) !== FALSE) {
/*******************************************************************************************
Values of content
(ignore)****content[0] = Time*******(ignore)
content[1] = Size
(ignore)****content[2] = Location***(ignore)
content[3] = City
content[4] = State
content[5] = Lat
content[6] = Long
content[7] = Comments
*******************************************************************************************/
if ($content !== false) {
?>
<script type="text/javascript">
places.push(new google.maps.LatLng(<?php echo json_encode($content[5]); ?>, <?php echo json_encode($content[6]); ?>));
</script>
<?php
}
Is there any way that when a page loads, some php code will run and get an array of information and then have that information be put into a javascript variable to use?