Python’s equivalent to PHP’s strip_tags?
Python’s equivalent to PHP’s strip_tags? http://php.net/manual/en/function.strip-tags.php
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no such thing in the Python standard library. It’s because Python is a general purpose language while PHP started as a Web oriented language.
Nevertheless, you have 3 solutions:
re.sub(r'<[^>]*?>', '', value)can be a quick and dirty solution.