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

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

WBOY
Release: 2016-06-13 13:34:53
Original
786 people have browsed it

一个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'];
         ...... 


Copy after login


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

------解决方案--------------------
PHP code
$a = preg_replace('/[\w.\/()]/i', '$0 ', $rows['old_title']); <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template