Re: How do I chop off the beginning of a string?

From: Date: Wed, 12 Jul 2000 16:05:08 +0000
Subject: Re: How do I chop off the beginning of a string?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-6174@lists.php.net to get a copy of this message
What you are looking for is ereg_replace (); ^ - is the beginning of a string; $ - is the end of a string; -> $str = ereg_replace ("^bla", "", $str); d. On Wed, 12 Jul 2000, Jason Bryner wrote: > Date: Wed, 12 Jul 2000 12:08:39 -0400 > From: Jason Bryner <jason@focusdesigngroup.com> > To: PHP General <php-general@lists.php.net> > Subject: [PHP] How do I chop off the beginning of a string? > > > I have the following strings being read in from a text file, one at a time. > How can I get rid of the beginning quotes and number? So it would end up > like so: > > => array("date"=>...... > > The strings are as so (the content changes, but still stays the same > format): > > "0" => array("date"=>"7/11/2000", > "author"=>"Jason Bryner", "next"=>"add") > ,"2" => array("date"=>"7/12/2000", > "author"=>"Me", "next"=>"add") > > This is what I tried: > $string = strstr($string, "\""); //Yep, it's supposed to be there twice > $string = strstr($string, "\""); > > Again, any help and suggestions would be appreciated. > > Jason Bryner > > > > > >

« previous php.general (#6174) next »