开发者

Preg_match PHP Folders

开发者 https://www.devze.com 2023-02-09 13:27 出处:网络
Can someone please show me how i can preg_match this so that it just shows t开发者_Python百科he file name??

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]);
0

精彩评论

暂无评论...
验证码 换一张
取 消