php: trim br tags from the beginning of a string?

Posted by Thanos on Stack Overflow See other posts from Stack Overflow or by Thanos
Published on 2010-05-14T12:07:41Z Indexed on 2010/05/14 12:14 UTC
Read the original article Hit count: 179

Filed under:
|

I know that:

preg_replace('<br\s*\/?>', '', $string);

will remove all br tags from $string...

How can we remove all <br><br/><br /> tags only if they are in the very beginning of $string? ($string in my case is html code with various tags...)

© Stack Overflow or respective owner

Related posts about php

Related posts about regex