Create websites with TailwindCSS
Design blocks for your website
Start building the next great SAAS
Alpine & Tailwind UI Library
Plug'n Play Authentication for Laravel
Create website designs with AI
Blog platform for developers
Build a simple static website
21-day program to build a SAAS
$a_date = "2009-11-23";
echo date("Y-m-t", strtotime($a_date));
What is wrong - The most elegant for me is using DateTime
I wonder I do not see DateTime::createFromFormat, one-liner
$lastDay = \DateTime::createFromFormat("Y-m-d", "2009-11-23")->format("Y-m...
Here is what the above code is doing:
1. strtotime() is a PHP function that converts a string to a Unix timestamp. In our case, we are converting the string "2009-11-23" to a Unix timestamp.
2. strtotime() returns a Unix timestamp, which is a number used to represent