Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created November 9, 2011 04:22
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 whyisjake/1350376 to your computer and use it in GitHub Desktop.
Save whyisjake/1350376 to your computer and use it in GitHub Desktop.
foreach in a foreach
<?php
$json = file_get_contents('http://makeprojects.com/api/0.1/guide/1019');
$json_output = json_decode($json);
$steps = $json_output->guide->steps;
foreach ($steps as $step) {
echo '<div>';
echo $step->title;
$images = $json_output->guide->steps->images;
foreach ($images as $image) {
echo $image->text;
}
echo '</div>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment