Quoting Andy Dirnberger <[EMAIL PROTECTED]>:

As far as i goes, I've always assumed it was just shorthand for something
like index or increment.  Nested for loops are often then controlled with j
and then k.  You can use these with confidence that people will understand
the meaning.  But if you feel more comfortable using a variable called
$counter than one called $i, by all means do so.  There are plenty of people
out there who refuse to use i.

The use of variable names like $i, $j, $k, etc for counters is a hold over from early Fortran which declared that only variables starting with certain letters could be integers. The first letter was "i". I seem to remember that only the letters i, j, l, l, m, n were used for integer variables, so the use quickly became a "standard" and it's been carried over into other languages through the use of examples written by old time programmers.

Ken
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to