Jump to content

Find an url?


Warptweet

Recommended Posts

I'm trying to read url's off of a website page by reading it's source code and locating http://www.??????.com/???? etc.

 

<embed src="http://www.somewebsite.com/someflash.swf" width="somewidth height="someheight">

 

Is it possible to locate a code in the source of a web page, except the exact link "http://www.somewebsite.com/someflash.swf" can be replaced with like %%%%%%%%%% so it simply finds it's similiar match? Otherwise I need to put in the exact url, and I want to search for all http urls instead.

 

Any tips or ideas on how to accomplish are appreciated.

 

Thanks,

-Warptweet

Link to comment
https://forums.phpfreaks.com/topic/73408-find-an-url/
Share on other sites

Yes, firstly you need to get the contents of the website. In most cases, file_get_contents() will do - though in more complex cases, you'll need to use cURL.

 

Then, you'll need to use regular expressions to find the links: preg_match() or ereg()

 

There's also a sub forum for regex:

 

http://www.phpfreaks.com/forums/index.php/board,43.0.html

Link to comment
https://forums.phpfreaks.com/topic/73408-find-an-url/#findComment-370458
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.