I am new to PHP and want to add 2 months to a specific date in the html code. How can I do it? I ask you to consult
Here is the code I'm using:
private function inputExpiryDate() { $value = $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; }
The question is, how can I add this
$date = strtotime(date("Ymd", strtotime($date)) . " +2 month"); ??
Any help really appreciated.
source share