
06-08-2006, 06:18
|
 |
|
|
חבר מתאריך: 09.12.01
הודעות: 2,337
|
|
|
לא בדיוק הבנתי את הקוד שלך...
קוד PHP:
<?php function gettitle($host, $atr) { $fp = fopen($host, $atr); if (!$fp) { echo 'Could not open'; } while (true) { $data=fread($fp,1024) or false; if (!$data) break; if (preg_match("/<title>(.*)<\/title>/imsU",$data,$match)) { echo var_dump($match); break; } } } gettitle("http://www.fresh.co.il/", "r"); ?>
עשיתי מספר שינויים מתבקשים בפונקציה
אם משהו לא מובן תשאל...
זה מה שהפונקציה מחזירה במקרה הנ"ל:
קוד:
array(2) { [0]=> string(41) "" [1]=> string(26) "פורום פרש - אינדקס פורומים" }
_____________________________________
“The man of wisdom is never in two minds about right and wrong;
the man of benevolence never worries about the future;
the man of courage is never afraid.”
~ Confucius
נערך לאחרונה ע"י The AcE בתאריך 06-08-2006 בשעה 06:22.
סיבה: בעיה עם הפורום? :ד
|