Jump to content

Strip domains/urls froma file


easyedy

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.