title: Use PHP and cURL to pull JSON data from mixed text / html / javascript file
body: <p>Using PHP and cURL on <a href="http://flyers.shoppersdrugmart.ca/flyers/shoppersdrugmart?type=2&amp;locale=en" rel="nofollow">THIS</a> link, returns a file containing information similar to this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;&lt;/head&gt;
      &lt;body&gt;
          &lt;script&gt;
              window['flyerData'] = {
                  "id":489640,
                  "categories":[{
                      "id":527,
                      "flyer_category_id":1201344,
                      "run_category_id":null,
                      "skipped":null,
                      "name":"Pharmacy",
                      "left":2925.0,
                      "bottom":-2560.0,
                      "right":4388.0,
                      "top":0.0,
                      "thumbnail_image_url":null
                  }]
              }
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>As you can see, the results are mixed html / javascript. What I would like to do is work with <code>window['flyerData']</code> so I can filter the values as I wish.</p>
  
  <p>How does one go about this using PHP and cURL?</p>