Fungsi dibawah ini bisa dugunakan untuk membuat file zip secara otomatis. /* creates a compressed zip file */ function create_zip($files = array(),$destination = ”,$overwrite = false) { //if the zip file already exists and overwrite is false, return false if(file_exists($destination) && !$overwrite) { return false; } //vars $valid_files = array(); //if files were passed in… if(is_array($files)) { //cycle through each file foreach($files as $file) { //make sure the file exists if(file_exists($file)) { $valid_files[] = $file; }

Read More

function list_files($dir) {     if(is_dir($dir))     {         if($handle = opendir($dir))         {             while(($file = readdir($handle)) !== false)             {                 if($file != “.” && $file != “..” && $file != “Thumbs.db”)                 {                     echo ‘<a target=”_blank” href=”‘.$dir.$file.’”>’.$file.'</a><br>’.”\n”;                 }             }             closedir($handle);         }     } }

Read More

function readable_random_string($length = 6){     $conso=array(“b”,”c”,”d”,”f”,”g”,”h”,”j”,”k”,”l”,     “m”,”n”,”p”,”r”,”s”,”t”,”v”,”w”,”x”,”y”,”z”);     $vocal=array(“a”,”e”,”i”,”o”,”u”);     $password=””;     srand ((double)microtime()*1000000);     $max = $length/2;     for($i=1; $i<=$max; $i++)     {     $password.=$conso[rand(0,19)];     $password.=$vocal[rand(0,4)];     }     return $password; }

Read More
WhatsApp chat