Last active
October 5, 2020 16:25
-
-
Save epierpont/aef99bf1aa448b4aaab132ad2fce725f to your computer and use it in GitHub Desktop.
PHP URL 404 loop
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 | |
// Loop through URL array and look for 404 results. | |
$url_array = ['https://facebook.com/','https://googlemaps.com/','https://gigglemips54252.com/', 'https://www.airbnb.com/']; | |
foreach ($url_array as $url_entry) { | |
$file_headers = @get_headers($url_entry); | |
$exists = !$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found' ? false : true; | |
echo $exists; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment