I’m trying to remove all hidden tags (and the ending tag) via regular expression and it seems to work but with one problem. It leaves behind “<>” for all the elements found.
I’m using this to replace my hidden fields with blank:
$saveContent = preg_replace('<input type="hidden" .*? />', "", $saveContent);
$saveContent = preg_replace('</form>', "", $saveContent);
It just brings back “<><><>” (2 Hidden fields and the ending form tag). I tried to string replace <> and that doesn’t seem to work either
Am I missing something?
Turns out for some reason (that I wasn’t aware of), the < and > symbols were being converted to entities, but only for a select few.
I just checked for those entities and string replaced them to the correct symbols and it worked.