http://images.google.com/imghp?hl=en&tab=wi http://maps.google.com/maps?hl=en&tab=wl http://news.google.com/nwshp?hl=en&tab=wn http://video.google.com/?hl=en&tab=wv http://mail.google.com/mail/?hl=en&tab=wm http://www.google.com/intl/en/options/ http://www.google.com/prdhp?hl=en&tab=wf http://groups.google.com/grphp?hl=en&tab=wg http://books.google.com/bkshp?hl=en&tab=wp http://scholar.google.com/schhp?hl=en&tab=ws http://www.google.com/finance?hl=en&tab=we http://blogsearch.google.com/?hl=en&tab=wb http://www.youtube.com/?hl=en&tab=w1 http://www.google.com/calendar/render?hl=en&tab=wc http://picasaweb.google.com/home?hl=en&tab=wq http://docs.google.com/?hl=en&tab=wo http://www.google.com/reader/view/?hl=en&tab=wy http://sites.google.com/?hl=en&tab=w3 http://www.google.com/intl/en/options/ /url?sa=p&pref=ig&pval=3&q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg https://www.google.com/accounts/Login?continue=http://www.google.com/&hl=en /intl/en_ALL/images/logo.gif /advanced_search?hl=en /preferences?hl=en /language_tools?hl=en /intl/en/ads/ /services/ /intl/en/about.html /intl/en/privacy.html
What do you mean, links that are not working or when you extract the link its not full ? try urlencode(); PHP:
Yeah, well then you just use urlencode(http://www.google.ie/search?q=digitalpoint&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a); PHP: When that gets passed it looks like this: http%3A%2F%2Fwww.google.ie%2Fsearch%3Fq%3Ddigitalpoint%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dorg.mozilla%3Aen-GB%3Aofficial%26client%3Dfirefox-a PHP: Which is what your script needs to keep it all together so to speak. You can store the urls encoded or decoded pending on which way you want to look at them you can urldecode(); which puts it back as the original.
@MyVodaFone I believe (if I understood correctly) the OP wants a way/method to extract links that contain the full url (ie. host/domain - and not just links to pages.
This should pick up all pages, scripts, etc..: $content = file_get_contents('http://forums.digitalpoint.com/showthread.php?t=1927248'); preg_match_all('/href="(\/?.*)"/Uism',$content,$results); print_r($results[1]); PHP:
this is exactly what i mean so instead of i get the link like this "/preferences?hl=en" i get the link like this "http://www.google.com/preferences?hl=en"
Looks like he's only getting the query string up to & which is why I thought he needed urlencode(), although its not very clear what the OP wants or is getting from his script. @ramysarwat please post your code here, so people can help you more efficiently.
I get it now, you will have to use this then: $link = 'http://forums.digitalpoint.com/showthread.php?t=1927248'; $hostURL = substr($link,0,strpos($link,'/',10)); $content = file_get_contents($link); preg_match_all('/href="(\/?.*)"/Uism',$content,$results); foreach($results[1] as &$curLink) { if(!stristr($curLink,'http://')) { $curLink = $hostURL.'/'.$curLink; } } print_r($results[1]); PHP:
this is exactly what i needed thank you very mush "ThePHPMaster" thank you very mush every body for help