fork(1) download
  1. <?php
  2.  
  3. $json = '{
  4. "serial": {
  5. "title_ru": "Во все тяжкие",
  6. "title_en": "Breaking Bad",
  7. "token": "ac68ccf3ec244f3f6980816b9a27cc36",
  8. "type": "serial",
  9. "kinopoisk_id": 404900,
  10. "translator": "LostFilm",
  11. "translator_id": 2,
  12. "last_episode_time": "2014-03-26 22:29:34",
  13. "iframe_url": "http://m...content-available-to-author-only...k.cc/serial/ac68ccf3ec244f3f6980816b9a27cc36/iframe"
  14. },
  15. "season_episodes_count": [
  16. {
  17. "season_number": 1,
  18. "episodes_count": 7
  19. },
  20. {
  21. "season_number": 2,
  22. "episodes_count": 13
  23. },
  24. {
  25. "season_number": 3,
  26. "episodes_count": 13
  27. },
  28. {
  29. "season_number": 4,
  30. "episodes_count": 13
  31. },
  32. {
  33. "season_number": 5,
  34. "episodes_count": 16
  35. }
  36. ]
  37. }';
  38. $jsonArray = json_decode($json);
  39. foreach($jsonArray->season_episodes_count as $element){
  40. echo $element->season_number."<br />";
  41. echo $element->episodes_count."<br />";
  42. }
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
1<br />7<br />2<br />13<br />3<br />13<br />4<br />13<br />5<br />16<br />