I am designing a client account management application and I need to provide a feature to update the account validity dates when the user renews his account.
I have a $activation_date, $validity and $expiry_date which hold the values fetched from the database. These are values of current subscipription details. Now, using another variable $validity_increment, I increase the valididty and calculate a new expiry date corresponding to the renewal.
Taking the case, where the renewal is made a few days before the existing expiry date, how will i find the new validity, which is logically,
Code: Select all
$validity_new = ($expiry_date_new - $expiry_date_old) + $vaidity_increment;