I need a code that prints every other line of a text file.
I.E
a text file contains:
hello
0
there
0
I just want
hello
there
to be displayed
how do you print every other line of a text file
Moderator: General Moderators
Re: how do you print every other line of a text file
Code: Select all
$file = file_get_contents('index.php');
$file = str_replace("\n0", "\n", $file);
echo $file;