Home  >  Article  >  Backend Development  >  过滤问题

过滤问题

WBOY
WBOYOriginal
2016-06-23 14:23:56812browse

$aa="无极dvd.中文.rmvb";
$aa="无极dvd.中文.rm";
$aa="无极dvd.中文.mp4";

怎样过滤掉.rmvb,.rm,.mp4后缀


回复讨论(解决方案)

$bb = str_replace(array('.rmvb','.rm','.mp4'),'',$aa)

<?php$a = '无极dvd.中文.mp4';$b = explode('.', $a, -1);echo join('.', $b);?>

$aa = "无极dvd.中文.rmvb";echo substr($aa, 0, strrpos($aa, '.'));
无极dvd.中文

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn