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 way useful for create mixed arguments function. function foo() { $args = func_get_args(); print_r($args); } foo(1, 1256, 6, 17); //mixed ... -------------------Out-...
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] != "+" ) { ...
Resize image function for jpg format. $mood between max and min. if you choose max, this mean max size of image is $ta otherwise min size of image is $ta. function makeTheThumb( $ppath, $ta, $mood ) ...
Create directory if not exists. function createDir( $dir ) { if ( !is_dir( $dir ) ) { mkdir( $dir, 0777 ); return true; } return false; }...