php怎样使一篇日志原样输出解决办法

WBOY
Release: 2016-06-13 13:32:58
Original
892 people have browsed it

php怎样使一篇日志原样输出
本人最近在做一个简易博客,从后面发表文章,在前台总是不能正常显示,全都靠右对齐,插入数据库时已经将空格转换成 
  等,public function str_to($str){
$str=str_replace(" ", " ", $str);
$str=str_replace(" $str=nl2br($str);
return $str;


插入数据库前,先将$content(文章内容)$content=str_to($content); 后插入怎么文字全都靠右对齐,不是空格都替换了吗,跪求高手解答!!!!!!!!!!!!!!!!!!

------解决方案--------------------
把这三句用这个函数代替:
htmlspecialchars()
------解决方案--------------------
再就是,你的问题与php没有关系,而是html页面的问题。

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!