Skip to content

Instantly share code, notes, and snippets.

Created June 1, 2013 01:02
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 anonymous/5688916 to your computer and use it in GitHub Desktop.
Save anonymous/5688916 to your computer and use it in GitHub Desktop.
<?php foreach ($movies as $movie_id => $movie): ?>
<tr>
<td><a href="movies.php?id=<?=$movie_id?>"><?=$movie->title?></a></td>
<td><?=date('Y', strtotime($movie->release_date))?></td>
<td><?=$movie->vote_average?></td>
<?php
$genres = array();
foreach ($movie->genres as $genre)
{
$genres[] = $genre->name;
if (!empty($_GET['genre']) && is_numeric($_GET['genre']) && $_GET['genre'] != $genre->id)
continue 2;
}
?>
<!--
<td><?=implode(', ', $genres)?></td>
-->
<td><?=$movie->overview?></td>
<td>[<a href="http://imdb.com/title/<?=$movie->imdb_id?>">IMDb</a>]
[<a href="http://www.themoviedb.org/movie/<?=$movie->id?>">TMDb</a>]
[<a href="movies.php?id=<?=$movie_id?>">Play</a>]</td>
</tr>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment