Reputation: 3181
I am new to PHP and cannot figure out the best method to convert two strings I have from URL params.
I would like to convert: "August 2010" to ---> "2010-08-%"
and also: "2010" to ---> "2010-%-%"
Thank you in advance!
Upvotes: 0
Views: 969
Reputation: 5112
You can do those by learn to using these 2 following functions
strtotime http://php.net/manual/en/function.strtotime.php
date http://php.net/manual/en/function.date.php
Upvotes: 2