i wont to convert string $s = "c:\java\java13\whatever.txt" into $p = "whatever.txt"
anybody ??
Hi blaz,
Try this
$p = strrchr ( $s, "\" );
The value of $p will be "\whatever.txt". You can use substr to remove the two backslashes from $p.
Ashutosh
Read the PHP manual about the string functions, you'll find a function called strrchr(). That fill tell you the location of the last slash in the string. THen use substr() to grab that part of the string starting at the last slash.