Location: PHPKode > scripts > Make Days List > make-days-list/ClassMakeDayslist.class.php
<?

/** 
	 * A small class that retrieve one array populated with days in date format or timestamp format for interval range date.  
	 * Author: Maran Emil Cristian
	 * Email: hide@address.com
	 **/


class DateTimeTransform{

function GenerateDaysList($W_START,$W_END){

$CCS = strtotime("$W_START"); // convert from date to timestamp
$CCE = strtotime("$W_END"); // convert from date to timestamp
$CCTOTAL = $CCE - $CCS; // make diference of timestamp
$CCDAYS = ceil($CCTOTAL/86400)+1; // return max days
for($i=0;$i<$CCDAYS;$i++){
$timestamp_alldays[]=($CCS+($i*86400)); //timestamp
//$data_alldays[] = date("Y-m-d H:i:s",$timestamp_alldays[$i]); // convert from timestamp to date
}
return $timestamp_alldays;
} // end method


} // end class

?>
Return current item: Make Days List