I want to "filter" string
to get only the date that is in it, string
is in that format:
SSC Napoli v Dnipro - Thursday 05/07/2015 04:05 PM
What I want to get is just 07/05/2015 16:05
, I used explode
:
$datas = eregi_replace('[.\A-Z\-]','', $datas);
$datas = explode("/",trim($datas));
$dia = substr($datas["0"], -2);
$datas = $dia."/".$datas["1"]."/".$datas["2"]."";
return $datas;
But the problem is that when the name of the team that is in the string has number, type:
SSC Napoli2 v Dnipro - Thursday 5/7/2015 4:05 PM
Obviously it will go wrong, I wanted to use something in regex
if I had how to extract that date and time, I am weak in regex
and already tried some things but it did not work!
Update :
I was able to make use of the following algorithm as well:
eregi_replace('[.\A-Z\-]','',substr($_GET["link"],-22));
But if someone has something more elaborate, please answer!