this is my code
$method = $_SERVER['PATH_INFO'];
and this is my path:
http://localhost:8082/XXXX/controllers/User.php/newUser?name=hello
the result of the method is /newUser
I would like to have just newUser
. IE without the /
could you help me please
use ltrim
on the variable you want ? Seems the easiest way to me
$var = ltrim($var,"/");
$method = ltrim($_SERVER['PATH_INFO'], '/');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With