Occurence php
layeures
Messages postés
286
Date d'inscription
Statut
Membre
Dernière intervention
-
layeures Messages postés 286 Date d'inscription Statut Membre Dernière intervention -
layeures Messages postés 286 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
mon script ne marche pas le probleme vien de la recuperation de l'occurence d une adresse web
$sourcea = strstr ($sourcea, "href=\"http://(a-z)"); //on cherche http ...
pouvez m aidez a resoudre ce probleme merci.
mon script ne marche pas le probleme vien de la recuperation de l'occurence d une adresse web
$sourcea = strstr ($sourcea, "href=\"http://(a-z)"); //on cherche http ...
pouvez m aidez a resoudre ce probleme merci.
A voir également:
- Occurence php
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour a la ligne php ✓ - Forum PHP
- Google sheet compter le nombre d'occurence ✓ - Forum Excel
- Supprimer occurence mot word ✓ - Forum Word
1 réponse
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++;
}
//}
?>