0 lain posted find string with max char length from array in php suppose i have array contained strings and i want to find max length string from array of strings $array=array("array","php","java","eclipse","webapi"); maxString($array); in PHP is there function which return me string which have max length in array at PHP . Edit Question
0 Mitul Dabhi answered Nov 30 '-1 00:00 findMaxLengthStringFromArray is can be used for the finding max length string from the array of string . function findMaxLengthStringFromArray($array){ foreach($array as $value){ $count[]=strlen($value); } arsort($count); return array($max=$array[current(array_keys($count))],current(array_keys($count))); } Edit Answer