Hi,
I am trying to loop a code(my php skills are not that great, so appreciate if someone here could help me walk through how to loop my code)
I have date input in the format as 21.03.15(DD.MM.YYYY) and would like to have it in 2015/03/21(YYYY/MM/DD) .
Note: I have a html textform that will get all the dates added to it , it will be in the following format:-
21.03.15
22.03.15
22.03.15
I would like it to come out as :
2015/03/21
2015/03/22
2015/03/22
Below is some things I came up with, but I cannot seem to come up with a looping logic. Appreciate if someone here could help me with the code below.
Thanks!
<?php
$var = "21.03.15" ;
echo $var;
echo "<br />";
$date = explode(".",$var); //
echo "20".$date[2].'/'.$date[1].'/'.$date[0];
?>