public static function findLengthyLines($msg, $max_len) { $lines = explode("\n", $msg); $lengthy_lines = array(); foreach ($lines as $i => $line) { if (strlen($line) > $max_len) { $lengthy_lines[] = ++$i; } } return $lengthy_lines; }