Re: converting C to PHP
| From: | David Robley | Date: | Thu, 13 Jun 2002 05:25:25 +0000 |
| Subject: | Re: converting C to PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101900@lists.php.net to get a copy of this message | ||
In article <6416776FCC55D511BC4E0090274EFEF508A46F@EXCHANGE>,
martin.towell@world.net says...
> I'm converting some C functions to PHP and have come across this:
>
> int skipf(..., char *format)
> {
> /* ... */
> cp = format;
> char *cp, *cp2;
> multiplier = strtol(cp, &cp2, 10);
> /* ... */
> }
>
>
> How can I implement this line in PHP ?
> multiplier = strtol(cp, &cp2, 10);
>
>
> Oh, and an example of format is "12L20W2P"
Non C programmer volunteers suggsetion. I looked at strtol in the C docs
and I don't quite understand exactly what it does. But I wonder if intval
would be a starting point to try and get the result I think you want?
--
David Robley
Temporary Kiwi!
Quod subigo farinam