array_sum() argument not an array
Posted: Fri Apr 23, 2010 9:02 am
I have the array in an include file,
in a file using that is the following,
and I get the error "The argument should be an array" for the "$Typ=" line.
Echoing the vars says that $_POST['Basic'] = 2 and $CurrVer = 1
Why is the argument not an array?
Code: Select all
$Qcnt = array(1=>array(1=>array(4,4,1,2,4),2=>array(4,4,1,2,4),3=>array(6,3,1,5,4),4=>array(3,3,1,5,4)), // number of questions
2=>array(1=>array(4,4,1,2,4),2=>array(4,4,1,2,4),3=>array(6,3,1,5,4),4=>array(3,3,1,5,4))); // in each segment
$CurrVer = 1; // applies to shopper creation and blank forms
Code: Select all
if (isset($_POST['Basic'])) // updating at basic level, moving on or not (status is zero)
{ // $_POST['Basic'] is the report type (1-4)
$Typ = array_sum($Qcnt[$CurrVer][$_POST['Basic']]); // some have more questions than others
Echoing the vars says that $_POST['Basic'] = 2 and $CurrVer = 1
Why is the argument not an array?