CODE
<?php
$arr = array(
'Pune' => '#ff0000',
'Nashik' => '#0000ff',
'Mumbai' => '#00ff00'
);
foreach ($arr as $something => $colour) : ?>
<p style="color:<?php echo $colour ?>"><?php echo $something ?></p>
<?php endforeach ?>
OUTPUT
<?php
$arr = array(
'Pune' => '#ff0000',
'Nashik' => '#0000ff',
'Mumbai' => '#00ff00'
);
foreach ($arr as $something => $colour) : ?>
<p style="color:<?php echo $colour ?>"><?php echo $something ?></p>
<?php endforeach ?>
OUTPUT
Pune
Nashik
Mumbai
New Zealand ETA
ReplyDelete