I’m new to both HTML & PHP. I’m attempting to remove multiple DOM elements from a parsed HTML string.
For example:
<tbody>
<tr>
<td>I'd like to find and remove this text</td>
<td>& possibly this too</td>
<td>can you help?</td>
</tr>
</tbody>
Thanks in advance!
Very simply if I were to remove lots of things from a string in PHP I would create an array of the parts to remove, loop through them and remove them one at a time from the big string.
Like
For more information on str_replace see http://php.net/manual/en/function.str-replace.php