Skip to content

Instantly share code, notes, and snippets.

@drdavidpier
Created December 11, 2013 20:32
Show Gist options
  • Save drdavidpier/7917919 to your computer and use it in GitHub Desktop.
Save drdavidpier/7917919 to your computer and use it in GitHub Desktop.
blog post view
<?php
$k = array_keys($post["id"]);
$v = array_values($post["id"]);
$rv = array_reverse($v, true);
$b = array_combine($k, $rv);
foreach (array_keys($b) as $key):?>
<div class="postDiv">
<h4><?php echo $post['title'][$key];?></h4>
<p><?php echo $post['summary'][$key];?></p>
<p><?php echo $post['content'][$key];?></p>
<div style="float:right">
<p><?php echo anchor('admin/edit/'.$post['id'][$key],' [edit]');?></p>
<p><?php echo anchor('admin/delete/'.$post['id'][$key],' [delete]');?></p>
</div>
</div>
<?php endforeach;?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment