开发者

php error: Fatal error: Can't use function return value in write context in /home/fadnyc/public_html/newstudent.php on line 62

开发者 https://www.devze.com 2023-01-10 17:41 出处:网络
for ($i=0; $i<10; $i++) { if ($choices($i)) { if ($selection(0)==\'first\'){ $selection(0)= $choices($i);// line 62
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) ."<开发者_C百科br />";
    }        
}  


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] ."";
    }
} 


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 ()?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号