@NEIL, Million thanks to you!![]()
@NEIL, Million thanks to you!![]()
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
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![]()
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($glob, array_map("file", $glob));
foreach($files as $key=>$value){
echo "<fieldset><legend>$key</legend>".nl2br(implode(array_slice($value, 0, 10)))."</fieldset>";
}
?>
Last edited by Nile; 12-30-2010 at 01:13 AM.
Jeremy | jfein.net
william james (12-30-2010)
Bookmarks