Re: Cut text from a string

From: Date: Thu, 02 Aug 2007 20:49:03 +0000
Subject: Re: Cut text from a string
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-260093@lists.php.net to get a copy of this message
On 8/2/07, Don Don <progwihz@yahoo.com> wrote: > I meant i want to get rid of the braces. e.g. get the text up to the start of the first brace > and ignore anything from the first brace onwards > > Dan Shirah <mrsquash2@gmail.com> wrote: Maybe I'm blind, but I don't see any > commas in the text you are referring > to. > > On 8/2/07, Don Don > wrote: > > > > hi all, am trying to cut some texts from a serries of string values e.g. > > > > "this is how we do (50 cents feat. the game)" > > "give it to me (nelly feat timerland)" > > "let me hold you (bow wow feat omarion)" > > > > i want to cut off the text between the comas and i've seen some examples > > > > > $string = "Hello world, this is a test"; > > preg_match('/.*<\/b>/i', $string, $result); > > echo strip_tags($result[0]); > > ?> > > > > > $string = "Hello world, this is a test"; > > list($junk, $good) = split('', $string); > > list($good, $junk) = split('', $good); > > echo $good; > > ?> > > > > but they wont work with comas > > > > > > --------------------------------- > > Yahoo! oneSearch: Finally, mobile search that gives answers, not web > > links. > > > > > --------------------------------- > Be a better Heartthrob. Get better relationship answers from someone who knows. > Yahoo! Answers - Check it out. The example I sent you should work. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107

« previous php.general (#260093) next »