1
Good afternoon person, someone could assist me in a doubt. I have this foreach that traverses an array and checks if the CURRENT DATE is equal to $value['Account']['data_expiration'] If it is he forwards an SMS informing that the account will expire.
foreach ($contasVencida as $key => $value) {
if (date("Y-m-d") == $value['Conta']['data_vencimento'] && !isset($_COOKIE['send_sms_Vayron'])){
//Faz envio do SMS
echo $this->element('NexmoMessage');
My doubt would be I would like to not warn the person on the day AND YES the day before or date("Y-m-d") -1 Day
In other words, you would have to take -1day from $value['Account']['expiration date'] because then I would do if the current date equals the maturity account -1Day
so that the SMS firing occurs one day before the account expires. account expires 19/03 the text triggered on 18/03
take a look at this link, maybe you can help in some way: https://celke.com.br/artigo/addr-e-subtrair-data-em-php
– RDamazio