Delete file function
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; } return false; }
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; } return false; }
The best way to determine the character count of a UTF8 string. function strlen_utf8( $str ) { return mb_strlen( $str, 'UTF-8' ); } //or... function strlen_utf8( $str ) { $c = 0;...
Create directory if not exists. function createDir( $dir ) { if ( !is_dir( $dir ) ) { mkdir( $dir, 0777 ); return true; } return false; }...
Format a number with grouped thousands......
Here is a function to getting ip using filter of local and lan ip's. function get_ip() { $list = array( 'REMOTE_ADDR', 'CLIENT_IP', 'HTTP_CLIENT_IP', 'HTTP_PROXY_CONNECTION',...