Check out my twitter script by CMXads
PHP Gallery PHP Gallery is a free php image script. | Sharp Stuff Switchblades Icepicks and german knives | Till death do us part Axels New Music releases | Evil gear Christmas is almost here |
here are some of the best and useful php scripts and snippets to help in your projects. Php displayed below. Use the search for specific script lookups. Click the category links to view scripts in Javascript and cgi. To add your own script click the link and add your useful script example.
read directory return links with first line of file as description
directory search file manipulation read and dis[;ay directory contents
directory links read line files
directory_read_file_lines Date added Jan 2013
<?php
$dir="scripts";
// read all html file in the current directory
if ($dh = opendir($dir)) {
$files = array();
while (($file = readdir($dh)) !== false) {
if (substr($file, strlen($file) - 4) == '.txt') {
array_push($files, $file);
}
}
closedir($dh);
}
// Sort the files and display
sort($files);
//$files=array_unique($files);
$trimsubdir = explode("/",$dir);
$subdir=$trimsubdir[1];
echo $subdir;
echo "<ul>";
foreach ($files as $file) {
$fh = fopen("$dir/$file", 'r');
$theData = fread($fh, 280);
fclose($fh);
$title = Title($file);
echo "<li><a href=\"$dir/$file\" title=\"$theData\">$theData</a></li>\n";
}
echo "</ul>";
// Function to get a human readable title from the filename
function Title($filename) {
$title = substr($filename, 0, strlen($filename) - 5);
$title = str_replace('-', ' ', $title);
$title = ucwords($title);
return $title;
}
?>