I can use $_ SERVER ["HTTP_HOST"]
to know the current web address
and also $_ SERVER [" PHP_SELF"]
to know which file I am loading now
for example, when I am in index.php
, he will show / index.php
if I am in admin/index.php
, he will show / admin/index.php
what I want to implement is
run a script
, but how can I tell if it is down under / admin/*.php?
how do I catch / admin/
? Do not decide which .php, just judge the file name before it
PS I want to use the basename (_ _ FILE__)
series, but my local side is one location, and the server side is another, so I have to make multiple decisions, which is not easy to use. _ SERVER
is the most monotonous, skipping the root root directory directly, but it doesn"t have the function of just grabbing files.