Re: strip <BR>(s) from the end of the string
| From: | Justin French | Date: | Mon, 19 Nov 2001 22:51:23 +0000 |
| Subject: | Re: strip <BR>(s) from the end of the string | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75169@lists.php.net to get a copy of this message | ||
Sorry, yeah, there are other <BR>'s in the string... I only want to chop
the trailing ones.
Justin
Brian Clark wrote:
>
> Hi Justin,
>
> @ 5:20:15 PM on 11/19/2001, Justin French wrote:
>
> JF> Some RegExp help here would be great... how do I strip one (or more)
> JF> <BR>'s from the END of a string?
>
> Are they always at the end of the string? No more anywhere else on the
> line?
>
> $string = str_replace('<BR>','',$string);
> $string = str_replace('<br>','',$string);
>
> Or maybe..
>
> $string = preg_replace('/(<br>)+$/i','',$string);
>
> (untested)
>
> --
> -Brian Clark | PGP is spoken here: 0xE4D0C7C8
> Please, DO NOT carbon copy me on list replies.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net