Question
PHP strip_tags
Hello,
I am trying to strip all html tags except the <p>, <strong> and <br> tags. I am running this line of code:
$desc = strip_tags($row_prd['prd_desc'], '<p> <strong> <i> <br> <br /> <BR>');
I dont get any errors but the only tag that is left remaining is the <strong> tag. Both the <p> and <br> tags are removed. I tried adding upper case <br> tags and the XHTML <br> tag but still, these tags are removed.
I tried running:
$desc = strip_tags($row_prd['prd_desc'], '<br>');
And this does not work either. How come the <br> and <p> tags are removed even though i am telling php not to remove them? I am running PHP 5.x
Any help is greatly appreciated.
Thanks!
I am trying to strip all html tags except the <p>, <strong> and <br> tags. I am running this line of code:
$desc = strip_tags($row_prd['prd_desc'], '<p> <strong> <i> <br> <br /> <BR>');
I dont get any errors but the only tag that is left remaining is the <strong> tag. Both the <p> and <br> tags are removed. I tried adding upper case <br> tags and the XHTML <br> tag but still, these tags are removed.
I tried running:
$desc = strip_tags($row_prd['prd_desc'], '<br>');
And this does not work either. How come the <br> and <p> tags are removed even though i am telling php not to remove them? I am running PHP 5.x
Any help is greatly appreciated.
Thanks!
