Answer the question
In order to leave comments, you need to log in
How to output string from json inside json in php?
Get a response from the server like this:
{"message":
[{"id":52957,"title":"название","description":"","subevents":
[{"id":542032,"date":"2017-02-05T10:00:00"}]
}]
[{"id":52917,"title":"название","description":"","subevents":
[{"id":542032,"date":"2017-02-05T10:00:00"}]
}]
}
$json = json_decode($result, true);
foreach ($json['message'] as $ob) {
echo "<div id='".$ob['id']."' class=\"item\"><img src=\"/templates/scoopit.jpg\" alt=\"...\">
<h4>".$ob['title']."</h4>
<small>".$ob['subevents']['date']."</small>
<p><a href=\"#\" class=\"btn btn-default\" role=\"button\">Подробнее</a></p>
</div>";
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question