Skip to content

Instantly share code, notes, and snippets.

@hikari-no-yume
Created March 1, 2015 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hikari-no-yume/c2b78034fd03334da61f to your computer and use it in GitHub Desktop.
Save hikari-no-yume/c2b78034fd03334da61f to your computer and use it in GitHub Desktop.
what_php_should_be
# 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