Ankit
Ankit

Reputation: 622

strip_tags function not working for <p> something</p>

i have a input like this

$desc = <p>\r\n test job description!</p>

i have used echo html_entity_decode(nl2br($desc),ENT_NOQUOTES,"Utf-8");

and out put becomes <p>\r\n test job description!</p>

then used echo html_entity_decode(stripslashes(nl2br($desc)),ENT_NOQUOTES,"Utf-8");

& got <p> test job description!</p>

& used echo strip_tags(html_entity_decode(stripslashes(nl2br($desc)),ENT_NOQUOTES,"Utf-8")); to get output like test job description! but the output becomes <p> test job description!</p>

what i am doing wrong here or what function i can use to get desired output test job description!

Upvotes: 0

Views: 2350

Answers (1)

JohnP
JohnP

Reputation: 50029

Your code

$desc = "&lt;p&gt;\r\n test job description!&lt;/p&gt;";
echo strip_tags(html_entity_decode(stripslashes(nl2br($desc)),ENT_NOQUOTES,"Utf-8"));

Outputs

test job description!

Either the data in your question is wrong or the code you're trying out is wrong. Double check and post again please.

Upvotes: 1

Related Questions