正则太菜

WBOY
WBOYOriginal
2016-06-13 10:25:06972browse

正则太菜,求助
$s = 'aaa.bbb.ccc.ddd...';
如何用正则替换成a.b.c.d...



------解决方案--------------------

PHP code
$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>
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