<?php print date('Y-m-d'); # eg 2026-12-31 print strtolower(date('YMd')); # eg 2026dec31 ?>
Programming Tips - PHP: How can I get the current date as a string?
Date: 2017nov25
Language: php
Q. PHP: How can I get the current date as a string?
A. Use the date() function: