【问题标题】:php function similar to .text() jQuery methodphp 函数类似于 .text() jQuery 方法
【发布时间】:2011-12-11 13:47:20
【问题描述】:

嗨,我想知道 php 中是否有一个函数可以接收这个1<sup>o</sup>semaster 并返回给我1o semaster 我希望 php 具有与 jquery 的 variable.text() 方法相同的功能

【问题讨论】:

  • 请注意,使用 strip_tags(如以下状态的帖子)时,您不会收到 1o semaster。你会得到1osemaster——所以..这可能只是一个错字,对吧?

标签: php jquery html text


【解决方案1】:

您可能正在寻找strip_tags

【讨论】:

  • 是的,我一直在寻找.. 谢谢大家!!
  • @MikulasDite: htmlspecialchars() 绝对不像 jQuery 的 .text()(见 jsfiddle),但 strip_tags() 是。
【解决方案2】:
$test = "1osemaster echo strip_tags($test);

【讨论】:

    猜你喜欢
    • 2012-07-09
    • 1970-01-01
    • 2013-10-12
    • 1970-01-01
    • 1970-01-01
    • 2015-10-04
    • 1970-01-01
    • 1970-01-01
    • 2013-12-11
    相关资源
    最近更新 更多