need value advice and help me to sort out the following issue.
function max_key($array) {
foreach ($array as $key => $val) {
if ($val == max($array)) return $key;
}
}
$SortingVote = array();
for ($i=0; $i<10; $i++) {
$SortingVote[] = $i;
}
$array = $SortingVote;
$array_count=count($array);
for($i=0;$i<=$array_count;$i++){
$max_val[$i]=max_key($array);
$voteValue_View=$array[$max_val[$i]];
unset($array[$max_val[$i]]);
$VoteValue_New[$i] = $voteValue_View;
echo "Vote Value manual = $VoteValue_New[$i] <br />";
}
It works fine and display the value when I am running it on my local machine via MAMP Mac version (PhP & MySQL). But, it display nothing when I deployed on my production server. And it is weird? Just received the following:
Vote Value manual =
Appreciate if anyone can guide me on this. Cheers
I’m just rewriting this, seems easier: