0

how can I parse certain Elements from a HTML File via PHP Thats my HTML File:

https://pastebin.com/raw/vVYqrCUd

I want to get the , and the from every item in the HTML File. Thats my current PHP Code:

$json_object= file_get_contents($url);
$json_decoded = json_decode($json_object);

preg_match_all('/<span class="(normal_price|market_listing_num_listings_qty|market_listing_item_name)">(.*)<\/span>/',$json_decoded->results_html, $sor);

foreach($sor[1] as $k => $v)
{
echo "Name" .$v[0]."<br/>";
echo "price" .$v[1]."<br/>";
echo "des" .$v[2]."<br/>";
}

Thanks a lot, With best Regards Maro

Maro
  • 55
  • 1
  • 7
  • "_I want to get the , and the from every item_" The what, what and what? – brombeer Feb 21 '18 at 19:24
  • I want to get the Name, quantity and Price from every item in the HTML File. These three infomations should be in one foreach for every item like in my example. – Maro Feb 21 '18 at 19:51

0 Answers0