Preg_match PHP Folders
Can someone please show me how i can preg_match this so that it just shows t开发者_Python百科he file name??
Music/dnb/Crazy Talk_Tantrum Desire_192.mp3
show it will just show.
Crazy Talk_Tantrum Desire_192.mp3
Having a right pain trying to get this to work, wasting far too much time on it any help please???
$name = basename('Music/dnb/Crazy Talk_Tantrum Desire_192.mp3');
if you're insisting on using regexps it could be:
preg_match('~/([^/]+)$~', 'Music/dnb/Crazy Talk_Tantrum Desire_192.mp3', $matches);
var_dump($matches[1]);
精彩评论