Saturday, August 24, 2013

Calendar Script PHP

Calendar Script PHP

<?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ $day = date('j'); //what day is it today $month = date('n'); //what month are we in? $year = date('Y'); //what year are we in? //get the first first day of the month $first_day_of_month = date('w',mktime(1,1,1,$month,1,$year)); $days_in_month = date('t');...
Square Roots in PHP

Square Roots in PHP

Doing square roots in PHP is really simple, all you need to do is to call the function sqrt().  Lets see some code. <?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ //Set number you would like to take square root $int = 9; //Take square root...

Saturday, August 17, 2013

Convert bytes to B, KB, MB, GB, TB, PB, EB, ZB, YB

Convert bytes to B, KB, MB, GB, TB, PB, EB, ZB, YB

Simple PHP function that formats the bytes to the desired form. Possible unit options are: Byte (B)Kilobyte (KB)Megabyte (MB)Gigabyte (GB)Terabyte (TB)Petabyte (PB)Exabyte (EB)Zettabyte (ZB)Yottabyte (YB) Function takes three parameter: (bytes mandatory, unit optional, decimals optional): <?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ function byteFormat($bytes, $unit...
PHP Memory Usage

PHP Memory Usage

This is a simple example of a class, which can be used to collect the PHP script memory usage information and to print all information. PHP Memory Usage - Class <?php /* Online PHP Examples with Source Code website: http://4evertutorials.blogspot.in/ */ class MemoryUsageInformation { private $real_usage; private $statistics...
Objects to Array php

Objects to Array php

Every PHP coders have come accross Arrays and stdClass Objects (belongs to PHP Predefined Classes). Sometimes it’s very useful convert Objects to Arrays and Arrays to Objects. This is easy if arrays and objects are one-dimensional, but might be little tricky if using multidimensional arrays and objects. This...

 

© 2014 4everTutorials. All rights resevered.

Back To Top