3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_time_limit(300); echo 'START'; flush(); $key = "hKRDnKagmecgYVrrDwBb"; $token = "5fqicwqzql1HsVE5uXnKubyvyKOaX4mYddL0"; $accountId = "28"; //$url = "https://dataapi.autoplay.co.nz/"; $url = "https://dataapi.aptest.co.nz/"; $fred = "?id=".$accountId; $fred .= "&yard=2867"; $fred .= "&pageSize=2"; $fred .= "&pageNumber=1"; $ch = curl_init($url.'search.ashx'.$fred); curl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // uncomment this line if you get no gateway response. ### curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_MAXREDIRS, 5); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_STDERR, $fp); $headers = array( 'Key: '.$key, 'Token: '.$token ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLINFO_HEADER_OUT, true); //curl_setopt($ch, CURLOPT_URL, $url."search.asx" ); //curl_setopt($ch, CURLOPT_POST, true ); //curl_setopt($ch, CURLOPT_POSTFIELDS, $Something is wrong); // use HTTP POST to send form data echo '<br>GOING TO DO REQUEST'; flush(); $result = curl_exec($ch); $headers_info = curl_getinfo($ch); echo "HEADERS:<pre>".print_r($headers_info, true)."</pre>"; flush(); echo "RESULT:<pre>".print_r($result, true)."</pre>"; flush(); ?>

preferences:
49.17 ms | 402 KiB | 5 Q