Skip to content

Instantly share code, notes, and snippets.

@wareya
Forked from hikari-no-yume/what_php_should_be.language
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wareya/679d7c314e74dbea5f22 to your computer and use it in GitHub Desktop.
Save wareya/679d7c314e74dbea5f22 to your computer and use it in GitHub Desktop.
# imagine, for a second:
db = new db('mysql:localhost');
results = (
select
(name, age, photo)
from
(db.elePHPants)
where
(age > 16)
);
list = "<ul></ul>";
for result in results
{
list.appendChild("
<li class="elephpant">
<img src="{result.photo}" alt="photo of {result.name}">
<span>{result.name}, age {result.age}</span>
</li>
");
}
render(list);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment