$maxLength = null;
$maxLengthIndex = null;
foreach ($array as $index => $value) {
$length = strlen($value);
if (is_null($maxLength) || $length > $maxLength) {
$maxLength = $length;
$maxLengthIndex = $index;
}
}
echo 'Самая длинная строка "' . $array[$maxLengthIndex] . '" под номером ' . $maxLengthIndex . '.';