View Single Post

  #5 (permalink)  
Old 12-06-2006
ZeldorBlat
 
Posts: n/a
Default Re: find last part of string


Peter wrote:
> Doing some testing.
> A small bug it seems, line 2 should be:
>
> $laststring = substr($mystring, strrpos($mystring, '_') + 1);
>
> >
> > $mystring = "abcd_123456_QWER_98765" ;
> > $laststring = substr($mystring, strrpos($mystring, '_'));
> > $numChars = strlen($laststring);
> >
> >


If I just gave you the code and it worked perfectly, you'd have no
reason to look at it and try to understand how it works :)

Reply With Quote