Miscellany
public php v1 · immutablefunction curl_string ($url,$user_agent){ $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_TIMEOUT, 120); $result = curl_exec ($ch); //echo htmlspecialchars($result); curl_close($ch); if (strpos('<?xml',$result) == FALSE) { sleep(1); curl_string ($url,$user_agent); }; return $result; }?>