Skip to content

Instantly share code, notes, and snippets.

@isstaif
Last active December 15, 2015 15:18
Show Gist options
  • Save isstaif/5280325 to your computer and use it in GitHub Desktop.
Save isstaif/5280325 to your computer and use it in GitHub Desktop.
A simple list using PHP
<html>
<head></head>
<body>
<?php
$post1 = array(
'title' => 'Title 1',
'body' => 'Body 1'
);
$post2 = array(
'title' => 'Another title',
'body' => 'Body Body Body!'
);
$post3 = array(
'title' => 'This is another title!',
'body' => 'OK! This is another body!'
);
$posts = array($post1, $post2, $post3);
foreach($posts as $post){
echo "<h1>".$post['title']."</h1>";
echo "<p>".$post['body']."</p>";
echo "<hr />";
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment