note 106505 added to function.date
| From: | bertoski at gmail dot com | Date: | Tue, 15 Nov 2011 06:14:50 +0000 |
| Subject: | note 106505 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184444@lists.php.net to get a copy of this message | ||
The Rod code it's inefficient and excessive large, use something like this instead.
El código de Rod es ineficiente y excesivamente largo, usen esto:
<?php
$dias = array("Domingo", "Lunes", "Martes", "Miercoles",
"Jueves", "Viernes", "Sabado");
$dia = $dias[date("w")];
?>
Try to avoid the use of switch whenever you can, it's a good practice.
Intentes evitar el uso de switch cuando puedan, es una buena practica y un operador (en mi
opinión) innecesario.
----
Server IP: 69.147.83.197
Probable Submitter: 190.16.90.155
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/106505
Del: integrated -- https://master.php.net/note/delete/106505/integrated
Del: useless -- https://master.php.net/note/delete/106505/useless
Del: bad code -- https://master.php.net/note/delete/106505/bad+code
Del: spam -- https://master.php.net/note/delete/106505/spam
Del: non-english -- https://master.php.net/note/delete/106505/non-english
Del: in docs -- https://master.php.net/note/delete/106505/in+docs
Del: other reasons-- https://master.php.net/note/delete/106505
Reject -- https://master.php.net/note/reject/106505
Search -- https://master.php.net/manage/user-notes.php