How to add 2 months in a date in PHP inside an HTML codes?

Olivio

New Member
I'm new to PHP and I want to add 2 months to a specific date in an html code. How can I do it? Please guide me through, Here's the code I use: \[code\] private function inputExpiryDate() { $value = http://stackoverflow.com/questions/12792926/$this->expiryDate; $html =""; $html .= '<label for="expirydate">Expiry Date:</label>'; $html .= '<input type="text" readonly name="expirydate" id="expirydate" value="'.$value.'">'; $html .= '<input type="button" id="expirydatebutton" onclick="getExpiryDate()">' . PHP_EOL; return $html;}\[/code\]Question is how will I add this \[code\]$date = strtotime(date("Y-m-d", strtotime($date)) . " +2 month"); ?? \[/code\]Any help is really appreciated.
 
Back
Top