Hi 😃
Say someone is directed to this URL: http://www.myweb.com/something_here/
How do I get the "something_here" out of the path and assign it to a variable?
Keep in mind the last forward slash might be omitted, "something_here" could be "something_else" or anything for that matter, or their could be more stuff after "something_here" like: http://www.myweb.com/something_here/index.php
THANKS in advance for any valuable help! /p
I believe there is a function called [man]parse_url[/man]. Perhaps that might be useful.
You could try basename();
That might do the trick for you, although it might only work on file names.
If that doesn't work try $_SERVER['PHP_SELF'];