Viking gear
Gear Gifts and Apparel
Evil gear
Christmas is almost here
PHP Gallery
PHP Gallery is a free php image script.
Sharp Stuff
Switchblades Icepicks and german knives

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($filestrlen($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($fh280);
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($filename0strlen($filename) - 5);
        
$title str_replace('-'' '$title);
        
$title ucwords($title);
        return 
$title;
    }
?>


Add your comment.













No comments yet

Search ScriptsnTips


Php JavaScripts CGI/Perl