求秒个简单正则,

WBOY
Release: 2016-06-23 14:03:08
Original
830 people have browsed it

$a='aa,aa,';
$b=preg_replace('#[.*]+(,)#','',$a);
echo $b;


求结果aa,aa

不要trim()函数要正则。


回复讨论(解决方案)

$a='aa,aa,';
$b=preg_replace('#,$#','',$a);
echo $b;


是这意思?

$a='aa,aa,';
$b=preg_replace('#,$#','',$a);
echo $b;


是这意思?

哎 退步了就这么个意思!

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