Ok,
Sometime ago I've got this code to extract urls from the Google News website:
I've been trying to adapt it to for example on the url "http://www.google.com" it should result only on "google"
Already tried :
But I get
So, does anybody has the solution to this little problem?
Thank you,
Tiago
Sometime ago I've got this code to extract urls from the Google News website:
PHP:
<?php
$url = "http://news.google.com/news/url?sa=T&ct=pt/17-0&fd=R&url=http://www.estadao.com.br/ultimas/nacional/noticias/2006/dez/13/2.htm&cid=1103238007&ei=8mmARcKVMb7maOid1dIO";
preg_match('/&url=(.*?)&cid=/', $url, $result);
echo $result[1]; // http://www.estadao.com.br/ultimas/nacional/noticias/2006/dez/13/2.htm
?>
I've been trying to adapt it to for example on the url "http://www.google.com" it should result only on "google"
Already tried :
PHP:
preg_match('/http://www.(.*?)./', $url, $result);
But I get
Warning: preg_match() [function.preg-match]: Unknown modifier '/' in D:\wamp\www\1.php on line 5
So, does anybody has the solution to this little problem?
Thank you,
Tiago








