To check if url exists not regular file
Tried
1. file_exists - just a test, should not be for a url
2. empty
3. fopen
All the above gave a “Does not exists
if(fopen("http://www.google.com",r)){ echo "exists"; } else { echo "doesnot exist"; }
I have ran out of ideas as to why its happening. the file has been given 777. Code is being tested from 127.0.0.1.
This is the only code on the page. I do not wish to use curl, and keep it simple and normal coding. Checked on Google and other Q’s on stackoverflow
All I want to check is if the URL is real.
You need to enable allow_url_fopen in your php.ini config file.