PHP's strip tags() equivalent in MYSQL?

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


5 points

Hi All,

Do we have Mysql equivalent function of PHP strip_tags? I have a field in my mysql table that has html in it. I want to strip tags when doing select.. just like PHP strip_tags()?

Any ideas?



4 points

I don't think we have any such function similar to php strip_tags() in mysql. You would have to do your select and then strip_tags() in your php code.

Anonymous's picture
Created by Anonymous
-2 points

Try this REPLACE(description, REGEXP '(<[a-zA-Z][^>]>)','')

Anonymous's picture
Created by Anonymous

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.