note 75020 added to function.preg-match-all
| From: | Tontonq at hotmail dot com | Date: | Tue, 08 May 2007 21:37:28 +0000 |
| Subject: | note 75020 added to function.preg-match-all | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126341@lists.php.net to get a copy of this message | ||
Example a source for getting links from google result page
<?php
$lang = "en"; # en tr de ..
$word = urlencode("we love php"); # u know why we have to use urlencode : )
$data = file_get_contents("http://www.google.com.tr/search?hl=$en&q=$word");
# im coming on
preg_match_all("'<h2 class=r><a
href=\"(.*?)\"'",$data,$results); #getting results
for($i=0;$i<=count($results[1])-1;$i++)
{
echo "link = " . $results[1][$i] . "<br>\n"; #dumping them :)
}
?>
thanx
----
Server IP: 85.111.6.23
Probable Submitter: 85.111.6.6 (proxied: 88.229.48.241)
----
Manual Page -- http://www.php.net/manual/en/function.preg-match-all.php
Edit -- https://master.php.net/note/edit/75020
Del: integrated -- https://master.php.net/note/delete/75020/integrated
Del: useless -- https://master.php.net/note/delete/75020/useless
Del: bad code -- https://master.php.net/note/delete/75020/bad+code
Del: spam -- https://master.php.net/note/delete/75020/spam
Del: non-english -- https://master.php.net/note/delete/75020/non-english
Del: in docs -- https://master.php.net/note/delete/75020/in+docs
Del: other reasons-- https://master.php.net/note/delete/75020
Reject -- https://master.php.net/note/reject/75020
Search -- https://master.php.net/manage/user-notes.php