Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Vérifier une url indexée sur Google script php
function indexed($url) {
$url = '' . urlencode($url);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Chrome 10');
if (!curl_exec($ch)) {
// var_dump('failed');
return false;
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
return $code == '200';
echo indexed('');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment