09-25-2007, 08:11 PM
|
#2 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
This code gives you a basic idea of how to do this. We loop through the lines in the file and issue the continue construct to any lines that are odd. So it begins at line 1, skips line 2, prints line 3, etcetera...
Glad you like it here as well :) !
PHP Code:
$aContents = file('file.txt');
for($iIndex = 0; $iIndex < count($aContents); $iIndex++) { if($iIndex % 2 == 1) { continue; } echo $aContents[$iIndex] . '<br />'; }
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|