thealgoslingers/algoslingfileanew

Rename file in unique and pretty way.

v1.0.0 2023-12-06 07:44 UTC

This package is auto-updated.

Last update: 2024-05-06 09:29:40 UTC


README

The package Algoslingfileanew allows you to give a unique name to your file. The mechanism is strong that no matter how many files you rename, even if they're millions they will still have their unique name preventing duplication of files. The package gives 4 options to rename file. (ie alphabets/numbers/hash/unique/alphanumeric) You can rename your file in unique way.

Contribution is allowed ❤️

How to install

-- composer require thealgoslingera/algoslingfileanew
HOW TO RENAME FILE AND/OR SAVE TO DIRECTORY
   <?php
   use Thealgoslingers\AlgoslingFileanew
   
   ## For file(s) being uploaded to server
   ## Please upload the file first
   ## Then use AlgoslingFileanew to rename it

   require "../vendor/autoload.php";
   
   $file = "path-to-your-file.extension";
   $AlgoslingFileanew = new AlgoslingFileanew;
   $newFile = $AlgoslingFileanew->renameFile($file,"Alnum");
   ## SAVE TO DIRECTORY (OPTIONAL) ##
   fopen("directory-path/$newFile","a");
   $AlgoslingFileanew = new AlgoslingFileanew();
   ?>

Tips

You may use strtolower($newFile) to rename in lowercase or strtoupper($newFile) to rename in uppercase