jigen7 Posted October 5, 2007 Share Posted October 5, 2007 can any1 help me??$all_url is an array of url list i want to get only the domain ex: http://www.phpfreaks.com/etc.., and so it must exclude: 1. all the urls that start with a number/ 2. if the url contains the word google exclude it also ... overall i need the domain only lol $x = $counter; while (++$x < 200) { if (preg_match('~http://(www\.)?([0-9]|(.+\.)?google\.com)~', $all_url[$x],$matches)) $urls[] = $matches[0]; //unset($all_url[$x]); } Link to comment https://forums.phpfreaks.com/topic/71890-preg-match-help-getting-valid-full-domain/ Share on other sites More sharing options...
trq Posted October 5, 2007 Share Posted October 5, 2007 Does parse_url help? Link to comment https://forums.phpfreaks.com/topic/71890-preg-match-help-getting-valid-full-domain/#findComment-362140 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.