How to get the length of longest string in an array

try

$maxlen = max(array_map('strlen', $ary));

Leave a Comment