Grow your CSS skills. Land your dream job.

Last updated on:

Randomize File Name

function randomizeFileName( $real_file_name ) {
               $name_parts = @explode( ".", $real_file_name );
               $ext = "";
               if ( count( $name_parts ) > 0 ) {
                       $ext = $name_parts[count( $name_parts ) - 1];
               }
               return substr(md5(uniqid(rand(),1)), -16) . "." . $ext;
}

Comments

  1. Osirix

    Hi Thanks for the snippet much needed

Leave a Comment

Current day month ye@r *

*May or may not contain any actual "CSS" or "Tricks".