Re: Re: Manipulating strings

From: Date: Wed, 08 Oct 2008 19:41:08 +0000
Subject: Re: Re: Manipulating strings
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-281604@lists.php.net to get a copy of this message
On Wed, 2008-10-08 at 11:37 -0700, Yeti wrote: > <?php > #let's say we got following string: > $some_string = '<br />blah blah<br />blah blah<br />'; > var_dump(explode('<br />', $some_string)); > /* OUTPUT: > array(4) { > [0]=> > string(0) "" > [1]=> > string(9) "blah blah" > [2]=> > string(9) "blah blah" > [3]=> > string(0) "" > } > */ > #So as you see index 0 and index 3 are empty strings. Keep that in mind > ?> > You could use trim() on it first. I believe that lets you take out the delimiters at the ends of the string. Ash www.ashleysheridan.co.uk

« previous php.general (#281604) next »