Last active
March 25, 2022 16:27
-
-
Save rodrigocorreaecastro/49168442d12e4622df53 to your computer and use it in GitHub Desktop.
Gerar parcelas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $debug = 'Y'; | |
| $dt_venc = '2022-03'; | |
| $qnt_parcelas = 6 | |
| //Prepara as parcelas por mês | |
| for($i=0;$i <= $qnt_parcelas; $i++): | |
| $dt_venc_mes = strtotime ( "+$i month" , strtotime ( $dt_venc ) ) ; | |
| $dt_venc_mes = date ( 'Y-m' , $dt_venc_mes ); | |
| $timestamp = strtotime($dt_venc_mes); | |
| echo ($debug == 'Y')? "(",$i, ", '",$dt_venc_mes,"', ",$timestamp,")" . PHP_EOL : null ; | |
| endif; //.for -> final preparação das parcelas por mês |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment