preg match - Thursday 6th of April 2017 to date via pregmatch php -


still learning php, know general programing having hard time convert following string date

date format follows

thursday 6th of april 2017

hi, still learning php, know general programing having hard time convert following string date thursday 6th of april 2017. can explode using space separator , remove letters date , month can array have think pregmatch should able solve have not been able figure out right combination. apreciated..

i can explode using space separator , remove letters date , month can array convert number month have seen examples pregmatch , should able solve have not been able figure out right combination. appreciated.

try this, might helpful you.

$date = "thursday 6th of april 2017"; $date = str_replace("of ", "", $date); $d = date_create_from_format('l js f y', $date); echo date_format($d, "y-m-d"); //2017-04-06 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -