[thelist] PHP Array loop help

Ben Phillips ben at inchima.com
Fri May 10 05:05:01 CDT 2002


>          //foreach ($cookieInfo as $a){
>          while(list($key, $value) = each($cookieInfo)){
>          if($v == $cookieInfo[0]){
>                  print "Link Info: $cookieInfo[1]\n<br>";
>          }

shouldn't you be testing for $v == $key here?

only had a quick glance at the code, but i think you should be testing
against $key and then printing $value. you are currently using
$cookieInfo[0] and $cookieInfo[1] - is that why only the first segment
is being matched and printed?

also your indenting is out, makes it trickier to read.

benji
inchima.com





More information about the thelist mailing list