Click to See Complete Forum and Search --> : Can someone explain this to me please?


xlegend
05-26-2003, 07:42 PM
count($lines) = count($R) + count($C)
foreach($R as $r){
print count($groups)
foreach($groups as $group){
print " "
print count($group)
}
print "\n"
}
foreach($C as $c){
print count($groups)
foreach($groups as $group){
print " "
print count($group)
}
print "\n"
}

jeffmott
05-26-2003, 11:00 PM
This would be better posted in the PHP section (since PHP is what it appears to be, though you have decided not to tell us what language you are using).

AdamGundry
05-27-2003, 05:20 AM
Yes, it looks like PHP. The variables $R, $C and $groups are presumably arrays - it would help if you posted the code that creates them. This is a rather complex series of foreach loops, which basically prints out a list of numbers - element counts in the various arrays.

For more information:
Count function (http://www.php.net/manual/en/function.count.php)
Foreach construct (http://www.php.net/manual/en/control-structures.foreach.php)

Adam

xlegend
05-27-2003, 06:36 PM
To php forum