easyedy Posted October 15, 2007 Share Posted October 15, 2007 Hi I'm trying to strip all the URL's ie: domain.com froma file and I just can't get this regex to work. Can anyone help...? $data = file_get_contents( 'http://www.fluffytails.ca/crlinks.asp' ); preg_match_all( "/href=\"(.+?)\"/i", $data, $matches, PREG_SET_ORDER ); if( $matches[0][1] ) { $data = $matches[0][1]; } else { $data = false; } echo $data; Link to comment https://forums.phpfreaks.com/topic/73335-strip-domainsurls-froma-file/ Share on other sites More sharing options...
effigy Posted October 16, 2007 Share Posted October 16, 2007 You need preg_replace. Link to comment https://forums.phpfreaks.com/topic/73335-strip-domainsurls-froma-file/#findComment-370800 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.