- date_default_timezone_set: documentation ( source)
- in_array: documentation ( source)
- printf: documentation ( source)
<?php
// just for you, my one true live <3 happy valentine :)
date_default_timezone_set( 'Europe/Budapest' );
$d = new DateTime('2015-01-01');
for ($i=0;$i<370;$i++) {
if ($d->format('Y')>2015) break;
if (!in_array( $d->format( 'N' ) , array( 6 , 7 ))) {
printf( "%s\n" , $d->format( 'Y-m-d' ) );
}
$d->add( new DateInterval( 'P1D' ) );
}
?>