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; }
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', '...
This function check if an e-mail address is valid or not. function valid_email($email) { return preg_match('/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/', $email);...
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...
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',...