PHP 空格有关问题

WBOY
Release: 2016-06-13 13:41:16
Original
1156 people have browsed it

PHP 空格问题
HI 各位大大
  在此请教一个问题
  我在MYSQL中有一条这样的记录:
  欢迎光临 我的微博
但是当选出这条记录的时候这有“欢迎光临” 后面我的微博是没有的
然后我用str_replace(" "," ",$abc)
还是显示“欢迎光临”
以上请帮忙下

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

PHP code

<?php $str = '欢迎光临 我的微博';
$str = preg_replace('/\s+/', '       ', $str);
 
echo $str; <div class="clear">
                 
              
              
        
            
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!