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