简体   繁体   中英

php strip_tags() troubles

I am making a project posting system that will have somewhat some markup, similar to bbcodes, When i'm fetching the data from the database I use

strip_tags($content,'<br />');

To remove any unwanted html tags, then I continue on to use

str_ireplace($markup,$html_t,$strip_tags);

And those are both placed in variables for easier working. I want to allow the <br /> tag because that is what is in my database to achieve line downs (nl2br) now for some reason it's not echoing out <br /> 's.

No whitespace in second param.

strip_tags($content,'<br>');

http://php.net/manual/en/function.strip-tags.php

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM