PHP - Getting Current URL

后端 未结 3 1100
无人及你
无人及你 2020-12-05 02:19

This seems like a common questions but none of them seem to be what i\'m looking for. If there is a website:

www.example.com/test.php

I want to pu

3条回答
  •  北海茫月
    2020-12-05 02:55

    $file = $_SERVER["SCRIPT_NAME"];
    $break = explode('/', $file);
    $pfile = $break[count($break) - 1]; 
    

提交回复
热议问题