dongxian0421 2014-05-06 18:07
浏览 57
已采纳

替换  与空间CKEditor

I need to save a text from CKEditor component to my DB and i need to replace   by normal space.I already tried :

$newString = str_replace(" "," ",$newString);

but it doesn't work! Any idea?

N.B. My string does have < and > so this workaround doesn't work too:How to replace &nbsp; to space?

String to be saved:

<p><strong>Objectifs</strong></p> <ul> <li><em>Accompagner&nbsp;: Accompagner par le biais de suivi individuel et de groupe, les familles vers la prise en charge de leur santé globale.</em></li> </ul> <ul> <li><em>Informer&nbsp;: Devenir une référence en santé préventive et mieux-être auprès des nouvelles familles. Rendre accessible toute information concernant la péri et post natalité des participants par tous les médiums disponibles.</em></li> </ul> <ul> <li><em>Enrichir&nbsp;: Guider les nouveaux parents à travers des expérimentations pratiques pour&nbsp; optimiser les apprentissages réalisés face à la santé globale de la famille et ainsi accroître leurs compétences et leurs capacités d''agir. </em></li> </ul> <ul> <li><em>Relier&nbsp;: Relier les différents intervenants en santé afin d''assurer une accessibilité et une vrai continuité de soins et de services aux familles.</em></li> </ul>

  • 写回答

2条回答 默认 最新

  • doudou521125 2014-05-06 18:34
    关注

    Found a workaround for CKEditor:

    In config.js: Add the following line config.basicEntities = false; at the end

    basic entities include : nbsp,gt,lt,amp

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测