I'm putting together a script in php
that will run on the 1st day of each month, generating an account to receive based on a value of 120,00 . That is, on the first day of each month it creates a 120.00 account.
The problem is that if the customer starts using the service on the 15th or any other day, he has to pay a value proportional to the days that he used. This is simple, I divide the 120.00 by the days of the month and then multiply by the days used. The problem is that I have no idea how to recover the days used.
If anyone can help me.
Follow the variables with the data I retrieve from DB.
$valor_mensalidade = 120;
$data_inicio = "2016-06-15";