How to remove BBCode with PHP
| Author | Message |
|---|---|
| Locust | # Posted two hours ago |
![]() |
Hello [IMAGE] my image [/IMAGE]should give me Hello everybodyI tried with str_replace but it leaves whatever content is between the BBCode tagsbasically I'd like to do the equivalent of strip_tags but with BBCode tags rather than HTMLexcept that I do not see how thank you |
| Ads | |
| Kalvin | # Posted two hours ago |
![]() |
You need to build your own function with |
| Valter | # Posted one hour ago |
![]() |
Anytime you are dealing with variable content between your tags you must use regular expressions. $text = '[IMAGE] my image [/IMAGE]which gives you: hello everyone welcome on my super blogsince there is no line-break. |
| Phoenix | # Posted one hour ago |
![]() |
Nice use of delimiters, fagg0t. |
| Locust | # Posted 7 minutes ago |
![]() |
thanks |
Post a reply
Please be kind and courteous in your replies. Don't roast others for no reason.



