English 中文(简体)
如何从 php 中的字符串中移除 sppecial 字符?
原标题:how to remove speacial characters from a string in php?

我在一个php网站工作

使用 wysig 编辑器更新要在页面上显示的内容数据

添加 默认在插入 Mysql 表格时有打开和关闭标签

当我在页上显示它的时候,它就出现了

        <?> with some black bakground

和内容为什么如此, 我如何在调取记录时动态删除或过滤它?

例如,例如

      // content goes in to website
      $ a = "<p> this content </p>" ;

{\fn方正黑体简体\fs18\b1\bord1\shad1\3cH2F2F2F

         "this content" 

任何帮助都将受到感谢

最佳回答

试试这个

$a = "<p> this content </p>" ;
$var = strip_tags($a);
echo $var
问题回答

我粗略地猜测,假设你正在使用TincMCE, 如果是的话, 请查看 < code> root_ root_ block 设置。 这很可能设置为 < code> p 。

http://www.tinymce.com/wiki.php/Configuation: 强迫性_root_block

如果您真的想走php- way, 请使用其它一个答案 。)

这将帮助你:

$string = "<h1>Heading</h1>"
$string = strip_tags($string);
$echo $tstring; // output ==> Heading




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签