tags:

views:

26

answers:

2
for ($i=0; $i<10; $i++) {
    if ($choices($i)) {
         if ($selection(0)=='first'){ 
                $selection(0)= $choices($i);  // line 62
         } 
       else{ $selection(1) = $choices($i);
       }     
    echo "ctr " . $ctr . $choices($i) ."<br />";
    }        
}  
A: 

What is $selection? Unless it contains the name of a function, you are doing something wrong. Same with $choices.

Perhaps you are confusing array notation [] with function notation ()?

Jason McCreary
+1  A: 

In PHP, use square brackets for array indices.

for ($i=0; $i<10; $i++) {
    if ($choices[$i]) { 
         if ($selection[0]=='first') {
              $selection[0] = $choices[$i]; // line 62
         } else{
              $selection[1] = $choices[$i];
         }
         echo "ctr " . $ctr . $choices[$i] ."";
    }
} 
Borealid