$arr = ["Ceylon", "Fish", "Apple", "MongoDB", "Zoomer-19"]; $result = []; $length = 0; array_map(function($v) use (&$length) { if ($length < mb_strlen($v)) { $length = mb_strlen($v); } }, $arr); foreach ($arr as $key => $value) { if ($length == mb_strlen($value)) { $result[] = $value; } } echo join(" ",$result); The code is clear to me in principle, but this part of the code is not quite
array_map(function($v) use (&$length) { if ($length < mb_strlen($v)) { $length = mb_strlen($v); } }, $arr); If you can easily explain why this part of the use (&$length) code and this and why is it behind the brackets?
}, $arr);
min(array_map('mb_strlen', $arr))- teran$length = min(...)- teran