Verificare key dacă este bun


(Eduard-Dan Stanescu) #23
$keys = array("căcat","4OqXX","6izIQ","PHZwk","uMChJ","oogh7");
$api_key = null;

foreach($keys as $key) {
	$url = "https://paste.ee/r/".$key."/0";
	$getHeaders = @get_headers($url);
	if($getHeaders[0] !== "HTTP/1.1 404 Not Found"){
		$getContent = @file_get_contents($url);
		if($getContent !== "false") {
			$api_key = $key;
			break;
		}
	}
}

echo $api_key; //6izIQ