Create directory function

Create directory if not exists.

function createDir( $dir )
{
   if ( !is_dir( $dir ) ) {
      mkdir( $dir, 0777 );
      return true;
   }
   return false;
}

Tags

No tag here.

Recommended pages

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($fi...

Best way to get user ip address in php...

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',...

Parse a string into separate words...

Parse a string into separate words (array output). function parser($str, $char = ' ') { $str = trim($str); $str = $str . $char; $len = strlen($str); $words = array(); $w = '...

Extract numbers from a unicode string...

Quick extract numbers from a unicode string......