3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-type: text/plaintext'); $url = 'http://www.pcdiga.com/2/12164/Motherboard-MSI-B85M-E45'; ///* function get_url_contents($url){ $crl = curl_init(); $timeout = 5; curl_setopt ($crl, CURLOPT_URL,$url); curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout); $ret = curl_exec($crl); curl_close($crl); return $ret; } //*/ //$page=file_get_contents($url); $page=get_url_contents($url); $price=preg_match("/span id\=\"preco_grelha\"\>(.*)<\/span\>/u", $page, $matches); print_r ($price); print ($matches); //print (); print ($page); ?>

preferences:
57.16 ms | 402 KiB | 5 Q