Randomize File Name Using this PHP function

a_bunch_of_files

Using this function you can display  random file names using php.

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;
}

About Bulent

Yes, my name is Bulent. I am originally from Turkey but now reside in United Kingdom. I have been working as a designer for over 8 years and have been very fortunate to have worked on a wide variety of projects. I have recently developed one of the most succesfull recruitment portal for nearly a million Turkish speaking community in UK within few months we had reached to nearly 65,000 users and stil growing. Thank you for stopping by!

Leave a comment

You must be logged in to post a comment.