I have this line.
$line = '/opt/fings/interface/20140905111645811106.txt 0';
I used this to disable the final 0/r/n .
$pos = strpos($lines[$x], ' '); $file = '.'.substr($lines[$x], 0, $pos);
so I stayed with this /opt/fings/interface/20140905111645811106.txt
But I only need the file name. e.g. 20140905111645811106.txt
Ho, do I take a string from the back until the first slash appears?
source share