开发者

How to encode the html entities using php

I am using ck editor to compose my mail , to send mails to my user I am using the libmail class. my issue is if I echo the posted data from the ckeditor eg: echo $message = $_POST['editor1'];

output : " < data > " but if I send the message using the libmail the mail sended like this

<p>
    &quot;&nbsp; &lt; data &gt;&nbsp; &quot;</p>
<br />

I already tried this combination:

1 . $message = strip_tags($message);

2 . $message = htmlentities($message,ENT_NOQUOTES,'UTF开发者_C百科-8');

3 . $message = htmlspecialchars(stripslashes(strip_tags($message)));

Still I could not able to solve this issue.


You tried the encoding functions. What you need is the decoding ones.

http://www.php.net/manual/en/function.html-entity-decode.php or http://php.net/manual/en/function.htmlspecialchars-decode.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜