3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getStr($string,$start,$end){ $str = explode($start,$string); $str = explode($end,$str[1]); return $str[0]; } $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.getproxylist.com/proxy?country=BR", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", // CURLOPT_POSTFIELDS => array( // "X-Mashape-Key" => "wQocH1wdCVmshfMaA4oY19xst3H1p1qNljIjsnusupjaYacLWe", // "Accept" => "application/json" // ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { //echo $response; } $token = getStr($response, ', "ip": "',', "port":',', "'); echo $token; ?>

preferences:
24.98 ms | 404 KiB | 5 Q