过滤问题

WBOY
Release: 2016-06-23 14:23:56
Original
798 people have browsed it

$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);?>
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!