5 Years ago(Updated in 5 Years ago) Web 0

We've created several minimal iPhone, Android, Lumia and iPad devices in pure CSS to showcase the prototypes our users make on Marvel. Grab the code, remix and...

5 Years ago(Updated in 5 Years ago) PHP(Functions) 0

Gregorian to Persian Date Convertor.

5 Years ago PHP(Functions) 0

Use this function to download a file from web to local machine.

function WgetFile( $URL, $dir )
{
   $nomefile = $dir . "/" . basename( $URL );
   if ( copy( $URL, $nomefile ) ) {
      return true;
   }
   else {
      return false;
   }
}
 
//Save file to drive c:
WgetFile( 'http://vtwo.ir/src/v2-logo.png', 'c:/' );

5 Years ago(Updated in 5 Years ago) PHP(Functions) 0

Use this function for change timestamp to custom format...

5 Years ago PHP(Functions) 0

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', 'GB' );
 
   while ( $file_size > 1000 ) {
      $i++;
      $file_size = $file_size / 1024;
   }
 
   return round( $file_size, 2 ) . " " . $name[$i];
 
}
 
echo formatFileSize( 1024 * 1024 ); //out = 1 MB

5 Years ago PHP(Functions) 0

Create directory if not exists.

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

5 Years ago PHP(Functions) 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;
   }
   return false;
}

5 Years ago(Updated in 5 Years ago) PHP(Functions) 0

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] != "+" ) {
      return false;
   } // end if
   else {
      $phone = substr( $phone, 1 ); // delete the "+"
      if ( !is_numeric( $phone ) ) {
         return false;
      } // end if
   } // end else
   return true;
} // end function is_valid_phone

5 Years ago(Updated in 1 Weeks ago) MySQL 0

Inner Join - MySQL Join
A simple way for don't forget MySQL Joins.

This learn graphic contains:
MINUS RIGHT JOIN or LEFT EXCLUDE JOIN
OUTER EXCLUDE JOIN
MINUS LEFT JOIN or RIGHT EXCLUDE JOIN
INNER JOIN
LEFT JOIN
RIGHT JOIN
OUTER JOIN
  Left Join - MySQL Join  Right Exclude Join - MySQL Join  Left Exclude Join - MySQL Join

Loading...