This is one way to check if the linked file on a page really exist, and at the same time to check if it is really a valid pdf or word file. Some will just return a html page, so you need to check the header.function is_valid_file($url) { $extension = pathinfo($url, PATHINFO_EXTENSION); $file_headers = @get_headers($url); … Continue reading PHP: Check if the linked file is a valid file
↧