I have the following php code where it goes through a loop and push elements to an array. I wanted to count elements in that array at the end of the loop. But it is not showing anything. Can someone please help me here?
<?php
$i=0;
$uphPerOperator = [];
while($i<10){
$uphPerOperator = array_push($uphPerOperator,$i);
$i++;
}
$uphArrayCount = count($uphPerOperator);
echo $uphArrayCount; ?>
array_pushthe wrong way, see the php manual to see how this function works and what it is supposed to return.