To get today's date in PHP, you can use the date()
function with the 'Y-m-d'
format parameter. This will return today's date in the format YYYY-mm-dd
.
main.php35 chars3 lines
Output:
main.php11 chars2 lines
You can also customize the format parameter to get the date in a different format. You can find more information on the available format parameters in the PHP documentation for the date()
function.
gistlibby LogSnag