<? if (eregi("functions_date.php",$PHP_SELF)) { // If accessed directly, header("Location:../index2.php"); // Sends you to your index page (mine is outside my functions dir.) die(); } ?> <? function conv_fecha($dia_larga) // this is the Day converter, mines does it to spanish { switch($dia_larga){ case "Monday": $dia_larga="Lunes"; return $dia_larga; break; case "Tuesday": $dia_larga="Martes"; return $dia_larga; break; case "Wednesday": $dia_larga="Miercoles"; return $dia_larga; break; case "Thursday": $dia_larga="Jueves"; return $dia_larga; break; case "Friday": $dia_larga="Viernes"; return $dia_larga; break; case "Saturday": $dia_larga="Sabado"; return $dia_larga; break; case "Sunday": $dia_larga="Domingo"; return $dia_larga; break; }} ?> <? function conv_mes($mes) // this is the Month converter, mines does it to spanish { switch($mes){ case 1: $mes="Enero"; return $mes; break; case 2: $mes="Febrero"; return $mes; break; case 3: $mes="Marzo"; return $mes; break; case 4: $mes="Abril"; return $mes; break; case 5: $mes="Mayo"; return$mes; break; case 6: $mes="Junio"; return $mes; break; case 7: $mes="Julio"; return $mes; break; case 8: $mes="Agosto"; return $mes; break; case 9: $mes="Septiembre"; return $mes; break; case 10: $mes="Octubre"; return $mes; break; case 11: $mes="Noviembre"; return $mes; break; case 12: $mes="Diciembre"; return $mes; break; }} ?> <? $dia_larga= date("l"); $dia=date("j"); $mes=date("n"); $year=date("Y"); // SENDS THE DAY AND MONTH TO THE FUNCTIONS TO BE CONVERTED $dia_larga=conv_fecha($dia_larga); $mes=conv_mes($mes); ?>
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.