fork(1) download
  1. <?php
  2. $diasTexto = Array("Domingo", "Segunda", "Terça", "Quarta", "Quinta","Sexta","Sábado");
  3. $dias = Array();
  4.  
  5. $data = new DateTime();
  6.  
  7.  
  8. for ($i = 0; $i < 7; ++$i){
  9. $diaSemana = $data->format("w");
  10. $dias[$diaSemana] = $data->format("d-m-Y");
  11. $data->add(new DateInterval('P1D'));
  12. }
  13.  
  14. for ($i = 0; $i < 7; ++$i){
  15. ?>
  16. <input type="checkbox" id="diasemana[]" name="diasemana[]" value="<?=$dias[$i]?>"><?=$diasTexto[$i]?><br>
  17. <?php
  18. }
Success #stdin #stdout 0s 83904KB
stdin
Standard input is empty
stdout
<input type="checkbox" id="diasemana[]" name="diasemana[]" value="15-10-2017">Domingo<br>
		<input type="checkbox" id="diasemana[]" name="diasemana[]" value="16-10-2017">Segunda<br>
		<input type="checkbox" id="diasemana[]" name="diasemana[]" value="17-10-2017">Terça<br>
		<input type="checkbox" id="diasemana[]" name="diasemana[]" value="18-10-2017">Quarta<br>
		<input type="checkbox" id="diasemana[]" name="diasemana[]" value="19-10-2017">Quinta<br>
		<input type="checkbox" id="diasemana[]" name="diasemana[]" value="20-10-2017">Sexta<br>
		<input type="checkbox" id="diasemana[]" name="diasemana[]" value="21-10-2017">Sábado<br>