<br style="clear: both">
The following regex doesn't work for me, what am I doing wrong?
return preg_replace('#<br[^>]+style="clear:both"[^/>]#is', '', $output);
thank you.
<br style="clear: both">
The following regex doesn't work for me, what am I doing wrong?
return preg_replace('#<br[^>]+style="clear:both"[^/>]#is', '', $output);
thank you.
If your string is always:
<br style="clear: both">
You can use str_replace
instead:
return str_replace('<br style="clear: both">', '', $output);
Beware that you shouldn't use regex for html manipulation.
Use some parser HTML instead.
You may escape chars like =, :, <, >, etc. Something like this:
<?php
return preg_replace('#\<br[^>]+style\=\"clear\:both\"[^/>]#is', '', $output);
?>
More better example:
<?php
return preg_replace('#\<br*.?\>#is', '', $output);
?>