Closed darkterminal closed 1 year ago
If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our GitHub Organisation - we help and encourage each other to contribute to open source little and often :neckbeard:. Any questions let us know.
The Back Story about your PHP Metaphor
I writing a story helper (little helper) to validate schema using PHP in my open-source project called SleekwareDB a Flat File database and RESTfull API using SleekDB. I know we have many libraries out there, never mind. It's just freestyled in my old language.
The PHP Story!
You can check if a string is a valid date or datetime format in PHP using the
DateTime::createFromFormat()
method. This method returns aDateTime
object if the input string is a valid date/datetime in the specified format, orfalse
if it is not valid.Here's an example function that checks whether a string is a valid date or datetime in the given format:
You can use this function like this:
This code will output:
That's it! Small and cringe... :smile:
A PHP demo/repos link
No response
PayPal Link for Donation (PHP Storyteller)
No response