-1

I would like to know if it is possible to change the string format in an array. So in my example down below I would like to change the $doletzterwurm['date'] format from 0000-00-00(year-month-day) to day-month-year.

I know that I use the old mysql query, I will change it soonish ;)

<?php
$search1 = "SELECT * FROM `wurm_stats` ORDER BY `id` DESC LIMIT 1";
$letzterwurm = mysql_query($search1);
while ($doletzterwurm= mysql_fetch_array($letzterwurm))
{
echo "<br></br><div style='text-align:center;color:#FFFFFF;font-size: 24px;'>Letzter Wurm Eintrag am "
     .$doletzterwurm['date'].
     " von "
     .$doletzterwurm['eingetragenvon'].
     " </br>";
}
?>
Songy
  • 851
  • 4
  • 17
kobii
  • 37
  • 1
  • 8

1 Answers1

0

It's possible, see the date function.

echo '[...]' . date('d-m-Y', $doletzterwurm['date']) . '[...]';
pavel
  • 26,538
  • 10
  • 45
  • 61