I use TinyMce for project. when i get the text from the user, i do the following with PHP
Now how do i safely insert, retrieve and display html data. One big challenge is to get only the text, without the html and make it available as the Meta description of the page.
In a nutshell i want to
You can use strip_tags()
you can use html2text class.
<?php
require_once(‘class.html2text.inc’);
$html = ‘Sample string with HTML code in it’;
$h2t =& new html2text($html);
$text = $h2t->get_text();
$h2t->print_text();
?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.