php - array_sum() expects parameter 1 to be array -
php - array_sum() expects parameter 1 to be array -
need help me crack following.
on local machine, i'm running mamp on mac. have next code:
$x=0; ($i=0; $i<=30; $i++) { $votevalue[$x] = $i; $x++; } $total = array_sum($votevalue); echo "<br /><br />total vote = $total <br />";
the above code works , run fine on local machine. but, when uploaded production server, next warning prompts:
warning: array_sum() expects parameter 1 array, null given in /home/rip/public_html/ripvote.php on line 7
and doesn't homecoming , show output value due warning error. how rid of this?
please advice , looking forwards hear guys soon. appreciate , thanks.
hmm, weird, dont know error in code, seek out :
$votevalue = array(); ($i=0; $i<=30; $i++) { $votevalue[] = $i; } $total = array_sum($votevalue); echo "<br /><br />total vote = $total <br />";
php arrays
Comments
Post a Comment