title: Scraping Javascript variables to PHP
body: <p>I'm trying to parse some HTML with Xpath but am finding out the the links I want to get are generated by some javascript and not using just a normal a anchor. The javascript is as follows:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var Hyperurl="ab5";
      var Hyperlink="46439157";
  &lt;/script&gt;
  </code></pre>
  
  <p>Now, I've used XPath to grab the script code via:</p>
  
  <pre><code>$xpath-&gt;query('//script[contains(.,"Hyper")]');
  </code></pre>
  
  <p>Which returns:</p>
  
  <pre><code>var Hyperurl="ab5";var Hyperlink="46439157";
  </code></pre>
  
  <p>My question is. How do I get this data into an array much like parse_url or the like? Should I just preg_match_all the variable storing the string? If so, what regex would I use? Or is there a better way to parse and grab the data I want?</p>
  
  <p>Thanks in advance!</p>