Is there a function in php to execute a regular expression that replaces the type of action with all entries in the array?
I have an array that contains a lot of html tags with text in them, and I want to remove the tags.
So basically I convert this:
$m = [ "<div>first string </div>", "<table> <tr> <td style='color:red'> second string </td> </tr> </table>", "<a href='/'> <B>third string</B><br/> </a>", ];
:
$m = [ "first string", "second string", "third string" ]
A regex that (hopefully) matches everything I want to remove is as follows:
/<.+>/sU
The question is, how should I use it now? (My array actually has more than 50 entries, and there can be 10 matches in each entry, so using preg_replace is probably not the way to go or is it?)
source share