Hi All,
 
I have a page where I'm collecting answers from a series of questions.
The questions are entered into the array one at a time so I can keep
track of paging.
$arans  =       array($_POST);
$_SESSION['arans'][$pageid] = $arans;

Then I want to check the sum of the array for scoring purposes. However
I have to get to the key that has the values for the scores.

for($i = 1; $i <= 10; $i++){
        print_r($_SESSION['arans'][$i]);
        print"<br>";
}

Give me this...
 
Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) ) 
Array ( [0] => Array ( [mc] => 10 [Submit] => Submit ) ) 
Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) ) 
Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) ) 
Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) ) 
Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) ) 
Array ( [0] => Array ( [mc] => 0 [Submit] => Submit ) ) 
Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) ) 
Array ( [0] => Array ( [mc] => 10 [Submit] => Submit ) ) 
Array ( [0] => Array ( [truefalse] => 10 [Submit] => Submit ) )

Ten separate arrays with an array at 0 that has the data I'm after.
This is where I'm getting stuck.  How can I get to the keys that are
either 'mc' or 'truefalse' and sum them?

Thanks,

alex hogan

 

*************************************************************************************
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*************************************************************************************

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to