Last active
August 29, 2015 14:18
-
-
Save rajankur/717f1e50178e2464c8f8 to your computer and use it in GitHub Desktop.
PHP: Fetch all links from a webpage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $html = gzdecode(file_get_contents('http://kat.ph')); | |
| preg_match_all('/https?\:\/\/[^\" ]+/i', $html, $links); | |
| var_dump($links); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment