Home >Backend Development >PHP Tutorial >关于多个空格HTML显示的有关问题

关于多个空格HTML显示的有关问题

WBOY
WBOYOriginal
2016-06-13 12:13:43920browse

关于多个空格HTML显示的问题
我用PHP从mysql数据库读取字段带有2个空格,比如abc  cde。使用echo显示出来后中间只有一个空格,这个是html空格机制,那如何按原样输出2个空格呢?请高手赐教
------解决思路----------------------
把空格替换成  

$s = 'abc  cde';<br />echo str_replace(' ', ' ', $s);

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