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/>";

27th Jul 2017, 3:06 PM
Md. Jahid Hasan
Md. Jahid Hasan - avatar
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
27th Jul 2017, 3:19 PM
Matte
Matte - avatar