Re: converting C to PHP

From: Date: Thu, 13 Jun 2002 04:29:38 +0000
Subject: Re: converting C to PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-101893@lists.php.net to get a copy of this message
On Thu, Jun 13, 2002 at 02:13:48PM +1000, Martin Towell wrote: > But what about the pointer &cp2 > > If endptr is not NULL, strtol() stores the address of the first > invalid character in *endptr. In you example endptr is always NULL! > If there were no digits at all, > strtol() stores the original value of nptr in *endptr. (Thus, > if *nptr is not \0' but **endptr is \0' on return, > the entire > string is valid.) Check if the returncode is false, then use $format instead. > Instead of a pointer - a position number would be okay.... > > (Actually, to get the number, I could just do "$cp-0" or "$cp*1" - gotta > love variants) From your example I got the impression you are only interested in multiplier.... -- Daniel Tryba

« previous php.general (#101893) next »