You are here: Re: Few lines of C++ to PHP « PHP Programming Language « IT news, forums, messages
Re: Few lines of C++ to PHP

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация