Home >Backend Development >PHP Tutorial >正则太菜
正则太菜,求助
$s = 'aaa.bbb.ccc.ddd...';
如何用正则替换成a.b.c.d...
------解决方案--------------------
$s = 'aaa.bbb.ccc.ddd...';echo preg_replace('/([a-z])+/i','\1',$s);<br><font color="#e78608">------解决方案--------------------</font><br>$s = 'aaa.bbb.ccc.ddd...';<br>echo preg_replace('/(\w)+/', '$1', $s); //a.b.c.d...<br><div class="clear"> </div>