Home  >  Article  >  Backend Development  >  一个PHP的有关问题,着急求解,困扰好久了,求大牛们帮助

一个PHP的有关问题,着急求解,困扰好久了,求大牛们帮助

WBOY
WBOYOriginal
2016-06-13 10:17:581000browse

一个PHP的问题,着急求解,困扰好久了,求大牛们帮助

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$query = mysql_query("select old_title from pagecontents where old_id = 6316 ") or die(mysql_error() );while ($rows=mysql_fetch_array($query)){    $a = $rows['old_title'];         ...... 


我想是把读取出来的old_title处理成,遇到英文,数字或者英文符号("./()_"),则加一个空格,该怎么处理啊?是不是要用正则?

------解决方案--------------------
PHP code
$a = preg_replace('/[\w.\/()]/i', '$0 ', $rows['old_title']);<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