title: Get the price of an item on Steam Community Market with PHP and Regex
body: <p>I'm trying to use PHP to get the Steam Community Market price of an item. I take a url (for example : <a href="http://steamcommunity.com/market/listings/730/StatTrak%E2%84%A2%20P250%20%7C%20Steel%20Disruption%20%28Factory%20New%29" rel="noreferrer">http://steamcommunity.com/market/listings/730/StatTrak%E2%84%A2%20P250%20%7C%20Steel%20Disruption%20%28Factory%20New%29</a>) and then I download the content with <code>file_get_contents()</code>. I tried to use this :</p>
  
  <pre><code>function getInnerHTML($string, $tagname, $closetagname) {
      $pattern = "/&lt;$tagname ?.*&gt;(.*)&lt;\/$closetagname&gt;/";
      preg_match($pattern, $string, $matches);
      return $matches[1];
  }
  </code></pre>
  
  <p>Using </p>
  
  <pre><code>getInnerHTML($str, 'span class="market_listing_price market_listing_price_with_fee"', 'span');
  </code></pre>
  
  <p>An example of what I can have with file_get_contents is this :</p>
  
  <pre><code>&lt;span class="market_table_value"&gt;
      &lt;span class="market_listing_price market_listing_price_with_fee"&gt;
          $1.92               &lt;/span&gt;
      &lt;span class="market_listing_price market_listing_price_without_fee"&gt;
          $1.68               &lt;/span&gt;
      &lt;br/&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>But it returns nothing. </p>
  
  <p>Has anyone an idea ?</p>