View Single Post
Old 09-25-2007, 08:11 PM   #2 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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 == 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.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote