Is there something similar to the file_exists function that can be used to apply to anchor points?
Such that the code can check if for example 'page.htm#anchor' exists, rather than just 'page.htm' on its own.
Thanks!
File exists function for anchor points?
Moderator: General Moderators
Re: File exists function for anchor points?
No, there isn't. (Of course you can create your own function or a class for that)Is there something similar to the file_exists function that can be used to apply to anchor points?
If your site is on-line, you can use for example the function file_get_contents to check if URL exists:
Code: Select all
if(file_get_contents('http://www.yoursite.com/page.htm#anchor'){
echo 'URL exists';
} else {
echo 'URL does not exists';
}
Re: File exists function for anchor points?
That works; thanks!
Though there seems to be an anchor bug in Firefox.
Though there seems to be an anchor bug in Firefox.