Skip to content

Instantly share code, notes, and snippets.

@Wpkenpachi
Created November 18, 2017 14:40
Show Gist options
  • Save Wpkenpachi/f6ea226c2b85d8c84d78c65224f1b773 to your computer and use it in GitHub Desktop.
Save Wpkenpachi/f6ea226c2b85d8c84d78c65224f1b773 to your computer and use it in GitHub Desktop.
<?php
$a = '02/02/2018';
$b = '10/07/2018';
$atual = $a;
$dia = null;
while($atual != $b){
$dia = DateTime::createFromFormat('d/m/Y', $atual)->format('D');
if( $dia == 'Thu' ){
echo "{$atual} é quinta<br>";
}
$atual = DateTime::createFromFormat('d/m/Y', $atual);
$atual->add(new DateInterval('P1D'));
$atual = $atual->format('d/m/Y');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment