How to Find Maximum Length of Associative Array in PHP

In some cases we need to find out maximum length of all elements in the associative array. We will find the solution in this article.

Consider the following associative array:


In the above array, we need to find out the maximum length for every element such as name, age and email respectively.

Expected Output


We can achieve the solution by the following PHP programming.


Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *