判断字符串并截取
//判断字符串中是否含有.f30.mp4 去掉并返回 $str = 'pc.podcasts.lizhi.cao.c64ed09517ebaa83195d15b8c6e85a4cc6c26c13.mp4.f30.mp4'; if (strpos($str, '.f30.mp4') !== false) { $str = substr($str, 0, -8); } echo $str; //返回值 pc.podcasts.lizhi.cao.c64ed09517ebaa83195d15b8c6e85a4cc6c26c13.mp4