Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Got your SOS message. Here are the changes you need to make:</p> <pre><code>$video_title = $json_data-&gt;{'entry'}-&gt;{'title'}-&gt;{'$t'}; $video_date = $json_data-&gt;{'entry'}-&gt;{'published'}-&gt;{'$t'}; $video_duration = $json_data-&gt;{'entry'}-&gt;{'media$group'}-&gt;{'yt$duration'}-&gt;{'seconds'}; $video_views = $json_data-&gt;{'entry'}-&gt;{'yt$statistics'}-&gt;{'viewCount'}; $video_description = $json_data-&gt;{'entry'}-&gt;{'media$group'}-&gt;{'media$description'}-&gt;{'$t'}; </code></pre> <p>Note that <code>$t</code> is literal <code>$</code> followed by <code>t</code>, not a variable named <code>$t</code>.</p> <p>Sample output for video id gzDS-Kfd5XQ:</p> <blockquote> <p>string(66) "Sesame Street: Ray Charles Sings "I Got A Song" With Bert &amp; Ernie"</p> <p>string(24) "2008-08-06T18:56:56.000Z"</p> <p>string(3) "129"</p> <p>string(6) "828277"</p> <p>string(342) "For more videos and games check out our new website at <a href="http://www.sesamestreet.org" rel="noreferrer">http://www.sesamestreet.org</a> </p> <p>In this video, Bert and Ernie perform with Ray Charles. </p> <p>Sesame Street is a production of Sesame Workshop, a nonprofit educational organization which also produces Pinky Dinky Doo, The Electric Company, and other programs for children around the world."</p> </blockquote> <p>PS: If you are comfortable with associative arrays, pass true as second parameter to <code>json_decode</code>:</p> <pre><code>mixed json_decode(string $json [, bool $assoc = false [, int $depth = 512 [, int $options = 0]]]) </code></pre> <p>PPS: It is much easier to <code>var_dump</code> the data, find all the bits you need and write the code afterwards.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload