-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsaludo.php
38 lines (31 loc) · 816 Bytes
/
saludo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
$fecha = date('Y-m-d');
//A español
$meses = array(
'January' => 'enero',
'February' => 'febrero',
'March' => 'marzo',
'April' => 'abril',
'May' => 'mayo',
'June' => 'junio',
'July' => 'julio',
'August' => 'agosto',
'September' => 'septiembre',
'October' => 'octubre',
'November' => 'noviembre',
'December' => 'diciembre'
);
$dias_semana = array(
'Monday' => 'lunes',
'Tuesday' => 'martes',
'Wednesday' => 'miércoles',
'Thursday' => 'jueves',
'Friday' => 'viernes',
'Saturday' => 'sábado',
'Sunday' => 'domingo'
);
//Cambiar el formato
$fecha_formato = strftime("%A %e de %B de %Y", strtotime($fecha));
//Reemplazar al español
$fecha_formato = strtr($fecha_formato, array_merge($meses, $dias_semana));
echo $fecha_formato;