I have a date stored in a class variable with the format mm/dd/aaaa (cause it's spanish) How can I convert it to a string in spanish? For example: I have 06/10/2011 convert that to: Viernes 10 de Junio de 2011. Can someone please guide me on this? Thank you.
Here's a start. You're on your own in regards to figuring out the name of the day! <?php $initial_date = '06/10/2011'; $date = explode('/', $initial_date); $months = array( '01' => 'enero', '02' => 'febrero', '03' => 'marzo', '04' => 'abril', '05' => 'mayo', '06' => 'junio', '07' => 'julio', '08' => 'agosto', '09' => 'setiembre', '10' => 'octubre', '11' => 'noviembre', '12' => 'diciembre', ); $day = $date[1]; $month = $months[$date[0]]; $year = $date[2]; echo $day.' de '.$month.' de '.$year.'.'; ?> PHP: