Detect file extension function
This function is used to find the file extension also you can use pathinfo() function for get information about a file path.
function ext($file_name) { return substr($file_name, strrpos($file_name, '.') + 1); }
This function is used to find the file extension also you can use pathinfo() function for get information about a file path.
function ext($file_name) { return substr($file_name, strrpos($file_name, '.') + 1); }
This function return formatting of file sizes in a human readable format. function formatFileSize( $size ) { $file_size = $size; $i = 0; $name = array( 'byte', 'kB', 'MB', '...
Chek if a phone numbers is valid, according to its syntax (should be: "+390523599314"). True if it's valid, False otherwise function is_valid_phone( $phone ) { if ( $phone[0] != "+" ) { ...
If you want to delete everything from folder (including subfolders) use this function. function removeDir( $dir ) { if ( is_dir( $dir ) ) { $objects = scandir( $dir ); foreach ( $o...
Encrypt function return different value with each execute but decrypt function return input value. for example: first execute: encrypt('hello') => 'axxdfg34', decrypt('axxdfg34') return 'hello'...