Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    if true go to next line

    Hi,

    Im looking for a function that allows me to get to the nest line of a file that is read if something is true eg...

    PHP Code:
            $fp fopen($filename"r"); //Open the server log
            
    $content fread($fpfilesize($filename));     // Read the server log   
            
    $content explode("\n"$content); // explode into array   
            
    $content  array_reverse($content ); // reverse the array

    $a 2;
    if (
    $a <'then goto next line of file'){
    then do some stuff in here}

    else{} 
    Can anyone help with this please??

    Thanks. Eon201

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    fgets will get the next line in the file pointer. There's an example with a loop on the manual page.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •