Get All URLs From Page
Ever needed to get all the urls from a string or a web page? No? Well, here is a script that will do it anyway. Basically it works on grabbbing anything beginning with http, or https, up to the next double comma " or a space. The results are then returned in an array where you can extract them for your use.
The above script will output a list of urls from the string like this..
http://www.example.com
http://www.example.net/file.php
http://www.example.org
http://phpro.org/tutorials/Introduction-to-PHP-Regex.html
https://www.example.com/file.php
http://www.example.net/file.php
http://www.example.org
http://phpro.org/tutorials/Introduction-to-PHP-Regex.html
https://www.example.com/file.php
0 comments:
Post a Comment