Skip to content

Instantly share code, notes, and snippets.

@sergiopvilar
Created September 4, 2012 23:07
Show Gist options
  • Save sergiopvilar/3627807 to your computer and use it in GitHub Desktop.
Save sergiopvilar/3627807 to your computer and use it in GitHub Desktop.
<?php
$datainicio = date('Y-m-d');
$diasuteis = 120;
$restante = $diasuteis+1;
for($i = 0; $restante>0; $i++):
$thisdata = strtotime('+'.$i.' day', strtotime($datainicio));
$thisdiasemana = date('N', $thisdata);
if($thisdiasemana < 6):
$restante--;
endif;
endfor;
echo date('d/m/Y', $thisdata);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment