Lucky2710 Posted July 21, 2010 Share Posted July 21, 2010 First off is this even possible? If so please help!!! I've got 2 arrays i'm trying to compare and i've gone at this at every angle i can think of and this seems to be the most promising if i can just get this 1 thing to work. Heres my code so far. for($i=0; $i< count($each); $i++) { $final = racePicks($each[0]); //This is the Admin Array $picks = racePicks($each[$i]); $final_sum = array_sum($final); $picks_sum = array_sum($picks); if ($final_sum == $picks_sum) { echo 'they got em right!'; } else { echo 'they got em wrong '; } } and so the problem seems to be that $final_sum = array_sum($final); & $picks_sum = array_sum($picks); aren't working. If anybody knows if how to make this work please let me know. And if you are 100% sure it aint gonna work tell me that too so i don't waste any more time. Thanks Link to comment https://forums.phpfreaks.com/topic/208481-using-array_sum-in-a-variable/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.