Biel. 9 Denunciar post Postado Agosto 10, 2016 Boa tarde a todos. Direto ao ponto. Pessoal o codigo abaixo exibe na tela dentro do select name -> setembro2016 até agosto2017 Gostaria que exibisse na tela dentro do select name -> agosto2016 até julho2017 <select name="mes" size="14" required > <?php setlocale(LC_ALL, 'portuguese'); date_default_timezone_set('America/Sao_Paulo'); $inicio = strtotime(date('d-m-Y')); $fim = strtotime("+12 month",$inicio); while($inicio < $fim){ $inicio = strtotime("+1 month", $inicio++); $exibe = utf8_encode(strftime('%B - %Y', $inicio)). '<br />'; echo $exibe; ?> <option value="<?php echo $exibe;?>"><?php echo $exibe;?></option> <?php }?> </select> Compartilhar este post Link para o post Compartilhar em outros sites
pokee 2 Denunciar post Postado Agosto 10, 2016 Pronto. <select name="mes" size="14" required > <?php setlocale(LC_ALL, 'portuguese'); date_default_timezone_set('America/Sao_Paulo'); $inicio = strtotime(date('d-m-Y')); $fim = strtotime("+12 month",$inicio); while($inicio < $fim){ $exibe = utf8_encode(strftime('%B - %Y', $inicio)). '<br />'; $inicio = strtotime("+1 month", $inicio++); echo $exibe; ?> <option value="<?php echo $exibe;?>"><?php echo $exibe;?></option> <?php }?> </select> Só inverti os fatores no while Compartilhar este post Link para o post Compartilhar em outros sites
Biel. 9 Denunciar post Postado Agosto 11, 2016 Pokee muito obrigado. Tarefa resolvida. :D Compartilhar este post Link para o post Compartilhar em outros sites