3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = 'http://www.tredz.co.uk/road-bikes'; $feed = file_get_contents($url); $pattern = '%<a class="ga" href="([^"]+)".*data-ga-label="(.*)">\s*<img.*\/>\s*<noscript>.*<\/div?\s*.*<div.*<div class="sales-price">\s*.*£((?:\d[,]*)+[.,]?\d{2})\s*<\/div?%Usim'; preg_match_all($pattern, $feed, $products); //echo "<pre>" ; var_dump($products[1]); echo "</pre>" ; $produrl = $products[1]; $prodname = $products[2]; $prodprice = $products[3];
based on uJDuq
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.2.6
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/k45DN on line 5 Warning: file_get_contents(http://www.tredz.co.uk/road-bikes): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/k45DN on line 5
Output for hhvm-3.15.4
Warning: Failed to open http://www.tredz.co.uk/road-bikes (Could not resolve host: www.tredz.co.uk) in /in/k45DN on line 5