Last active
December 15, 2015 15:18
-
-
Save isstaif/5280325 to your computer and use it in GitHub Desktop.
A simple list using PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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