Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Echo last updated file

  1. #11
    Join Date
    May 2010
    Posts
    30
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    @NEIL, Million thanks to you!

  2. #12
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    No problem, I'm glad to help

    Here on DD, we like to keep things organized. In an effort to do so, you have the option to set a thread to resolved when an issue is fixed. To make the status of the thread resolved:
    1. Go to your first post
    2. Edit your first post
    3. Click "Go Advanced"
    4. In the dropdown next to the title, select "RESOLVED"
    Jeremy | jfein.net

  3. #13
    Join Date
    May 2010
    Posts
    30
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    wew I think this is my ultimate goal, to show first 10 lines for each txt files from a folder into my homepage!

    Please help me again

  4. #14
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    So, type in a directory and get all the files in that folder and then display the first 10 lines of each file on a page?
    PHP Code:
    <?php
    $dir 
    "texts"// the directory name

    $glob glob($dir."/*.*"); // get all the files with a 'name.extension' name
    $files array_combine($globarray_map("file"$glob));

    foreach(
    $files as $key=>$value){
        echo 
    "<fieldset><legend>$key</legend>".nl2br(implode(array_slice($value010)))."</fieldset>";
    }
    ?>
    Last edited by Nile; 12-30-2010 at 01:13 AM.
    Jeremy | jfein.net

  5. The Following User Says Thank You to Nile For This Useful Post:

    william james (12-30-2010)

Bookmarks

Posting Permissions

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