im getting stuck when i save string with paragraph, and the html tags <p></p>
and <br></br>
is come to save into database, if i use strip_tags()
the string is being RAW..
anyone can help me pleasee..
sorry for my poor english
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
if you need to have exceptions for your tags you can do
strip_tags($string,"<p><br>");
this will remove all tags except p and br.
to escape a string you can use
mysql_real_escape_string($str);
or just
addslashes($str);
回答2:
The strip_tags()
function takes a second argument:
string strip_tags ( string $str [, string $allowable_tags ] )
If you specify which tags you want saved (e.g., strip_tags($text, '<p><br>');
), it will not remove those tags.
回答3:
u can use strip_tags();
and also possible to use jq; its very easy and efective,, u can use
$('<p>').attr('disabled',"disabled"");
if u any help comment my link i ll tell u