title: Using cURL to GET api data within PHP
body: <p>I have made a simple api end point using Kimono for pulling Arkansas Waterfowl Reports and their respective post dates.</p>
  
  <p>I am given the below api url from Kimono:</p>
  
  <pre><code>curl --include --request GET "http://www.kimonolabs.com/api/e45oypq8?apikey=XXXXX"
  </code></pre>
  
  <p>Because I am not familiar with how to pull data using cURL, I went to the web and read multiple articles, tutorials on pulling data from an api using cURL.  I feel that there is about 1 million ways to do this.  I have spent too much time banging head on desk. This is what I came up with:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
    &lt;?php
      $json_string = file_get_contents("http://www.kimonolabs.com/api/e45oypq8?apikey=XXX");
      $parsed_json = json_decode($json_string);
      $title = $parsed_json-&gt;{'results'}-&gt;{'collection1'}-&gt;{'title'};
      $posted = $parsed_json-&gt;{'results'}-&gt;{'collection1'}-&gt;{'posted'};
      echo "${title} \n ${posted}\n\n";
    ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The api endpoint spits out the following (truncated for length of question):</p>
  
  <pre><code>{
    name: "agfc",
    lastrunstatus: "success",
    lastsuccess: "Fri Jan 17 2014 06:39:54 GMT+0000 (UTC)",
    nextrun: "Sat Jan 18 2014 06:39:54 GMT+0000 (UTC)",
    frequency: "daily",
    newdata: true,
    results: {
        collection1: [
            {
              title: {
              text: "January 8, 2014 Weekly Waterfowl Report",
              href: "http://e2.ma/message/zgkue/nnlu0d"
              },
              posted: "1/8/2014"
              }
            ]
  }
  </code></pre>
  
  <p>I simply want to pull all of the data from the api endpoint and 'echo' '$title' and '$posted' linking to the attributed url('href') of each of the data points.</p>
  
  <p>I am sure there is an easy way to do it.  I am missing something.  Thanks for your help.</p>