Get all subsets of array

1 Months ago(Updated in 1 Months ago) PHP(Functions) 0

If you have a list of items (for example)...

Continue

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

Quick extract numbers from a unicode string...

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

parse_str() is fine for simple stuff but it's not the same as PHP's built way of creating the $_GET magic variable. Why?!?...

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

Format a number with grouped thousands...

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

Function subwords, gets words by max num.

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

Loading...