Re: Odd behavior
| From: | Roman Neuhauser | Date: | Mon, 25 Dec 2006 15:21:59 +0000 |
| Subject: | Re: Odd behavior | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-246209@lists.php.net to get a copy of this message | ||
# jekillen@prodigy.net / 2006-12-24 18:11:03 -0800:
> function display($list, $in, $out, $save, $req, $x)
> {
> for($i = 0; $i < count($in); $i++)
> {$j = $i + 1;
> // two sets of links displayed instead of one
> for($i = 0; $i < count($out); $i++)
> {$j = $i + 1;
> // two sets of links displayed instead of one
> for($i = 0; $i < count($save); $i++)
> {$j = $i + 1;
> // two sets of links displayed instead of one
> for($i = 0; $i < count($req); $i++)
> {$j = $i + 1;
> // two sets of links displayed instead of one
> The print lines above are supposed to produce a list of links to files.
> In the web display I get duplicate sets of links which seems to mean
> that the loops in the function are running twice, and in one instance
> three times instead of once.
Look at the variable names you use for iteration.
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991