Occurence php
Fermé
layeures
Messages postés
286
Date d'inscription
mercredi 13 juin 2007
Statut
Membre
Dernière intervention
22 juin 2018
-
26 déc. 2009 à 11:48
layeures Messages postés 286 Date d'inscription mercredi 13 juin 2007 Statut Membre Dernière intervention 22 juin 2018 - 26 déc. 2009 à 13:41
layeures Messages postés 286 Date d'inscription mercredi 13 juin 2007 Statut Membre Dernière intervention 22 juin 2018 - 26 déc. 2009 à 13:41
A voir également:
- Occurence php
- Easy php - Télécharger - Divers Web & Internet
- Bouton php - Forum PHP
- Google sheet compter le nombre d'occurence ✓ - Forum Excel
- Compter le nombre d’occurrences de la valeur d'une cellule dans une plage - Forum Excel
- Google Sheet, compter un caractère dans une cellule ✓ - Forum Google Docs
1 réponse
layeures
Messages postés
286
Date d'inscription
mercredi 13 juin 2007
Statut
Membre
Dernière intervention
22 juin 2018
3
26 déc. 2009 à 13:41
26 déc. 2009 à 13:41
aidez moi si vous plait
voici le code
<?php
//$mot = "emploi";
// par defaut : $url = "http://www.lycos.fr/?query=".$mot."&page2=".$nb;
//https://fr.search.yahoo.com/search?p=dede&ei=UTF-8&rd=r1&fr=yfp-t-703&xargs=0&pstart=1&b=11
//http://recherche.netscape.fr/...
$url = "https://www.google.fr/search?hl=fr&rlz=1R2SUNC_frFR356&q=dede&start=10&sa=N&gws_rd=ssl";
$ada = fopen ($url, "r");
$file = file ($url);
$source = "";
while (!feof($ada)){
$source .= fgets ($ada, 1024);
}
$i =0;
$d = count($file);
while ($i <$d){
$sourcea = $source;
$sourcea = strstr($sourcea, "href=\"http://"); //on cherche http ...
//**http%3a//
$var_string_exp = explode("\"",$sourcea);
$var_string_exp2 = array_slice($var_string_exp, 0,2);
$sourcea = implode("\"",$var_string_exp2);
$source = str_replace ($sourcea,"888",$source);
$sourcea = str_replace ("href=\"","",$sourcea);
echo $sourcea."<br />";
if ($sourcea !== ""){
//echo "<iframe src=\"test2 simple.php?url=".$sourcea."\" width=100%></iframe>";
}
$i++;
}
//}
?>
voici le code
<?php
//$mot = "emploi";
// par defaut : $url = "http://www.lycos.fr/?query=".$mot."&page2=".$nb;
//https://fr.search.yahoo.com/search?p=dede&ei=UTF-8&rd=r1&fr=yfp-t-703&xargs=0&pstart=1&b=11
//http://recherche.netscape.fr/...
$url = "https://www.google.fr/search?hl=fr&rlz=1R2SUNC_frFR356&q=dede&start=10&sa=N&gws_rd=ssl";
$ada = fopen ($url, "r");
$file = file ($url);
$source = "";
while (!feof($ada)){
$source .= fgets ($ada, 1024);
}
$i =0;
$d = count($file);
while ($i <$d){
$sourcea = $source;
$sourcea = strstr($sourcea, "href=\"http://"); //on cherche http ...
//**http%3a//
$var_string_exp = explode("\"",$sourcea);
$var_string_exp2 = array_slice($var_string_exp, 0,2);
$sourcea = implode("\"",$var_string_exp2);
$source = str_replace ($sourcea,"888",$source);
$sourcea = str_replace ("href=\"","",$sourcea);
echo $sourcea."<br />";
if ($sourcea !== ""){
//echo "<iframe src=\"test2 simple.php?url=".$sourcea."\" width=100%></iframe>";
}
$i++;
}
//}
?>