0
1.Why the output of the following programme is 2 ?
<?php $arr['name1']="solo"; $arr['name1']+="learn"; $arr['name1']="ab"; $arr['name2']="1"; echo count($arr); echo "<br/>";
1 Answer
+ 1
it is because the "arr" array has two elements that are 'name1' and 'name2'.
count($arr) returns the number of elements inside the array
https://code.sololearn.com/wRGX48r2fUFi/?ref=app