PHP foreach loop (multi-dimensional array)
<div class="interactive-map">
<?php
$locations = array(
array(
"id" => "north-america",
"title" => "North America",
"top" => 13,
"left" => 15
),
array(
"id" => "central-america",
"title" => "Central America & Caribbean Basin",
"top" => 40,
"left" => 18
),
array(
"id" => "south-america",
"title" => "South America",
"top" => 77,
"left" => 28
),
array(
"id" => "europe",
"title" => "Europe",
"top" => 10,
"left" => 60
),
array(
"id" => "asia-pacific",
"title" => "Asia Pacific",
"top" => 20,
"left" => 82.5
)
);
?>
<?php foreach($locations as $location) { ?>
<div class="map-point" style="top:<?php echo $location['top']; ?>%; left:<?php echo $location['left']; ?>%;" id="<?php echo $location['id']; ?>" title="<?php echo $location['title']; ?>">
<div class='pin'></div>
<div class='pulse'></div>
</div>
<?php } ?>
</div>