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); }
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 file exists then delete the file. function delFile( $file_name ) { if ( file_exists( $file_name ) ) // Does '$file_name' exist { unlink( $file_name ); return true; } ...
Create directory if not exists. function createDir( $dir ) { if ( !is_dir( $dir ) ) { mkdir( $dir, 0777 ); return true; } return false; }...
Translates a number to a short alhanumeric version. e.g.: 9007199254740989 --> PpQXn7COf In most cases this is better than totally random ID generators because this can easily avoid duplicate ID's. Fo...