[Solved] How to detect second occurrence of an empty line in a text file?
[ad_1] Assuming that $arr is the lines of the file… $emptyLinesSkipped = 0; foreach ($arr as $value) { if (” === trim($value)) { if ($emptyLinesSkipped < 2) { $emptyLinesSkipped = $emptyLinesSkipped + 1; continue; } $item3 = $value; // and so on… } } [ad_2] solved How to detect second occurrence of an empty line … Read more