Is there a function which can be used to get the number of columns of a 2D array?
I've come to realize that count() function will display the number of rows inside the 2D array but am interested in getting the number of columns inside each array.
How can I use the count() function or any other function to get the number of elements inside an array contained inside another array.
Here is a sample of the code that am working with:
<?php
$people = array(
array("Rodrick","Java","PHP"),
array("Jane","Python","Javascript"),
array("Tom","Python","R"),
array("Wangari","Ruby","Kotlin"),
);
for($row = 0 ; $row < count($people) ; $row++){
echo "The Programmers ".$row;
echo "<ol>";
for($col = 0 ; $col < 3 ;$col++){
echo "<li>".$people[$row][$col]."</li>";
}
echo "</ol>";
}