In stead of:
for ($i < 0; $i < count($array_X); $i++) {
// do something....
}
One can do this and only one count() is executed:
for ($i < 0, $cnt = count($array_X); $i < $cnt; $i++) {
// do something....
}
I alright has a little concern when I put in that count(), or whatever expensive operation in the evaluation. But never think of this trick, even I know about I can initialize more than one value in a loop.
My passion has always been on software development, and I know it since I
wrote my first program on an Apple II. I worked on cellular wireless system
in the past (C/C++) and now focus on web application
(LAMP, PHP, MySQL, CakePHP, Symfony, jQuery, Google AppEngine/python).
![[Valid XHTML 1.0 Strict]](https://edmondhui.ddns.net/blog/skins/admun3/valid-xhtml.png)