Hi, I have a path in a variable
$var = "path/to/page" ;
How can I strip this so that $var only contains the last directory? In this example I want $var to become
$var = "page" ;
Thanks!
Edit: I need to be able to use this in any situation ($var may contain a longer path etc) so I need a method that doesn't just count the string position; I need something that will cut any content after the last backslash. Thanks!