Re: A string question

From: Date: Fri, 28 Sep 2012 13:31:35 +0000
Subject: Re: A string question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-319296@lists.php.net to get a copy of this message
On 29/09/2012, at 1:29 AM, Chris Payne <oxygenet32@gmail.com> wrote: > Hi there everyone, > > I basically have the following code, which grabs the 3 numbers to the right: > > $input = "250705023"; > > $resta = substr($input, -3, 3); > > Then I manipulate them a little, but my question is - how, once i've used > them to create different values - can I put them back in the original > string at the same location? > > Got me a bit confused. > > Chris One way: $input = substr($input, 0, -3) . $resta; --- Simon Welsh Admin of http://simon.geek.nz/

« previous php.general (#319296) next »