Using PHP, given a string such as: this is a <strong>string</strong>; I need a function to strip out ALL html tags so that the output is: this is a string. Any ideas? Thanks in advance.
Using PHP, given a string such as: this is a <strong>string</strong> ; I need
Share
PHP has a built-in function that does exactly what you want:
strip_tagsIf you expect broken HTML, you are going to need to load it into a DOM parser and then extract the text.