Posted by Michael Fesser on 01/05/07 08:32
..oO(Skeleton Man)
>for ($i=0;$i<strlen($myString);$i++)
Just a general performance note: In this case strlen() will be called
again in each iteration, which can become an issue in a long-running
loop or with a more complex expression.
The value to check against should be put in a variable instead before
entering the loop, e.g.
for ($i = 0, $l = strlen($myString); $i < $l; $i++) {
...
}
Micha
[Back to original message]
|