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]); } Quote 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? Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.