http://nans.stefanini.free.fr * Blog : http://www.22h22.fr */ //renvoie une url longue raccourcie function ShortDisplayURLggp($FullPath,$MaxLenght=65) { If (strlen($FullPath) > $MaxLenght) { //Suppression des arguments et fragment si néces"saire if (strpos($FullPath,";#",0) > 0) $FullPath = substr($FullPath,0,strpos($FullPath,"#",0)); if (strpos($FullPath,";?",0) > 0) $FullPath = substr($FullPath,0,strpos($FullPath,"?",0)); If (strlen($FullPath) > $MaxLenght) { // Decompose RL $FullPathParsed=parse_url($FullPath); // Parties minimales $RootPath = $FullPathParsed['scheme'].'://'.$FullPathParsed['host']; // Slash de fin si dossier if (substr($FullPathParsed['path'],-1) == '/') { $FullPathParsed['path'] = substr($FullPathParsed['path'],0,-1); $isFolder = TRUE; } else { $isFolder = FALSE; } $PathBaseName = basename($FullPathParsed['path']); $FullPathParsed['path'] = substr($FullPathParsed['path'],0,-1*strlen($PathBaseName)-1); // Pas besoin de citer ndex if (($PathBaseName == 'index.html') OR ($PathBaseName == 'index.php') OR ($PathBaseName == 'index.php3')) { $FullPathParsed['path'] = substr($FullPathParsed['path'],0,-1*strlen($PathBaseName)-1); $PathBaseName = basename($FullPathParsed['path']); $isFolder = TRUE; } if ($PathBaseName == '') { if (strlen($RootPath) > $MaxLenght) $RootPath = $FullPathParsed['scheme'].'://'.ShortDisplayHostggp($FullPathParsed['host'],$MaxLenght - strlen($FullPathParsed['scheme']) - 3); return $RootPath; } else if ($FullPathParsed['path'] == '') { return $RootPath.'/…/'.$PathBaseName; } else if ((strlen($RootPath)+strlen($PathBaseName)+3) >= $MaxLenght) { return $RootPath.'/…/'.$PathBaseName; } else { // Reduction du chemin while ((strlen($RootPath)+strlen($PathBaseName)+strlen($FullPathParsed['path'])+3) > $MaxLenght) { $FullPathParsed['path'] = substr($FullPathParsed['path'],0,-1*strlen(basename($FullPathParsed['path']))-1); } if ($FullPathParsed['path'] == '') { return $RootPath.'/…/'.$PathBaseName; } else { return $RootPath.$FullPathParsed['path'].'/…/'.$PathBaseName; } } } Else { return $FullPath; } } Else { return $FullPath; } } function ShortDisplayHostggp($FullHost,$MaxLenght=80) { If (strlen($FullHost) > $MaxLenght) { if (substr_count($FullHost,'.') >= 2) { return $FullHost; } else if (substr_count($FullHost,'.') == 1) { $extension = substr($FullHost,strpos($FullHost,".",0)); $FullHost = substr($FullHost,0,strpos($FullHost,".",0)); $FullHost = substr($FullHost,0,10).'(…)'.substr($FullHost,-1*(10+3+1+strlen($extension))).'.'.$extension; } else { $FullHost = substr($FullHost,0,$MaxLenght-3).'(…)'; } } else { return $FullHost; } } function ShortDisplayNameggp($FullName,$MaxLenght=50) { If (strlen($FullName) > $MaxLenght) { $FullName = substr($FullName,0,$MaxLenght-3).'(…)'; return $FullName; } else { return $FullName; } } ?> ', '', $index); $index = str_replace ('', '', $index); /* Résultats 1 - 10 sur un total d'environ 1 780 pour cogestar (0,15 second Résultats 61 - 66 sur 66 pour cogestar. (0,79 secondes) */ // nombre de liens trouvés preg_match_all('%sur[\s]*(un total d\'environ)* (([0-9 ]*)*) pour%si', $index, $nbliens); /* */ $nblien = $nbliens[2][0]; $nblien = str_replace (' ', '', $nblien); // si la requette ne retourne rien on quite la fonction if (!isset($nblien)) { return 'false'; break; } preg_match_all('%\
'; print_r($out); echo ''; */ $tabfin = array(); foreach ($out[1] as $key => $value) { /* preg_match_all('%(\
';
print_r($out2);
echo '';
*/
// description
$q = '\';
print_r($out2[1]);
print_r($out2[2]);
print_r($out2[4]);
echo '';
echo '';
print_r($out3);
echo '';
*/
}
/*
*/
/*
echo '';
print_r($tabfin);
echo '';
echo '