0
I have the function below, which makes the date sum, with the value +2 days fixed:
echo date('d/m/Y', strtotime("+2 days",strtotime($ultima_data)));
It sums correctly with the value of $last date, but somehow need to change the +2 days for a value that is in another variable, but so far could not. I tried the forms below, unsuccessfully:
echo date('d/m/Y', strtotime($dias_frequencia,strtotime($ultima_data)));
echo date('d/m/Y', strtotime("+'$ultima_frequencia'days",strtotime($ultima_data)));
In both cases there was no error, but returned values 1969... Any idea?
http://answall.com/q/120381/91 and remove those single quotes there.
– rray
You missed a spot here:
"+'$ultima_frequencia'days"
wouldn’t be like this"+'$ultima_frequencia' days"
?– Guilherme Nascimento
@rray was worth again. Another one I will write in the notebook kkk. Guilherme Nascimento changed everything to double quotes, as in the question that rray sent and worked. Thanks for the answers!
– Diego
Oh it’s true, I didn’t even notice it =)
– Guilherme Nascimento
I understand that it has been a long time dear Diego, yet I think it deserved a technical answer: https://answall.com/a/324727/3635 :)
– Guilherme Nascimento