Home >Backend Development >PHP Tutorial >求秒个容易正则

求秒个容易正则

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:18:08728browse

求秒个简单正则,
$a='aa,aa,';
$b=preg_replace('#[.*]+(,)#','',$a);
echo $b;


求结果aa,aa

不要trim()函数要正则。


------解决方案--------------------
$a='aa,aa,';
$b=preg_replace('#,$#','',$a);
echo $b;


是这意思?
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