I have created a 2D Array and trying to access each elements but i am receiving wrong value of each array .I can see only Today as the value
<?php
$blog = array (
0 => array('by' => "Nilay Mehta", 'on' => "Today", 'id' => "Today", 'post' => "Today"),
1 => array('by' => "Nilay Mehta", 'on' => "Today", 'id' => "Today", 'post' => "Today"),
2 => array('by' => "Nilay Mehta", 'on' => "Today", 'id' => "Today", 'post' => "Today"),
3 => array('by' => "Nilay Mehta", 'on' => "Today", 'id' => "Today", 'post' => "Today"),
);
foreach($blog as $blog)
{
echo "<a href=\"#\">".$blog['by']."</a>";
echo "<div class=\"blogtime\"> - ".$blog['on']."</div>";
echo "<div class=\"blogtime\">Blog Post ID - ".$blog['id'];
echo $blog['post'];
}
?>