Home >Backend Development >PHP Tutorial >求秒个简单正则,
$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;
是这意思?
哎 退步了就这么个意思!