
23-05-2008, 12:30
|
|
|
|
חבר מתאריך: 13.07.06
הודעות: 326
|
|
|
חיפוש בדף אינטרנט
שלום,
בניתי קוד קטן לחיפוש באינרנט.
קוד PHP:
file2 =file_get_contents($url); $file = htmlspecialchars($file2); if (strstr($file2,$word[$i])) { $ex = strstr($file2 ,$word[$i]);//find the word in the text $num = strlen($word[$i]);//the size of the word i am looking(in int) $pri = substr($ex , 0 , $num);// return $num charts from $file $pri2 = substr($ex , 0 , 20);// return 20 charts from $file $line = STRPOS($file2,$word[$i]);// line number of the word echo " The word '<b>{$word[$i]}</b>' found in line $line"; echo "<pre> the full sentance : '<b>$pri2</b>'<br></pre>"; } else { echo "The word {$word[$i]} wasnt found in the page <b>$url</b>"; } echo "<br>"; $i++; }
הבעיה היא שזה מציג לי גם את הhtml.
איך אני יכול להוריד את הhtml?
תודה.
נערך לאחרונה ע"י barakk בתאריך 23-05-2008 בשעה 12:33.
|