We have urls:
http://site.com/movies/posters/ID.html
http://site.com/movies/posters/fixed/ID.html
How do I know if /posters/fixed/
is present in the current url (on opened page)?
Like:
if ("/posters/fixed/" present) {
$match_fixed = true;
}
Thanks.
if (preg_match("//posters/fixed/", $_SERVER['REQUEST_URI'])) ...
If you want to check if a file exists, then you can simply call
file_exists()
.I take the PHP file is copied in the server root directory.
If you want to verify the URL used to access the files you reported (assuming they are really PHP files, and you put the code inside them to verify the URL used to access them, then the following code works:
If you meant something else, then extend the question so it's clearer what you mean.