I need to find all dates in a string and convert them to the format "d.m.Y"
.
I know how to simply convert a date to another format using strtotime()
and date()
, but how do I convert all dates in a string?
For example,
Some text 2018-08-28 11:56:48 .Some text 2017-10-30 07:39:21
will be converted to
Some text 28.08.2018 11:56:48 .Some text 30.10.2017 07:39:21