11.09.2018 Views

Aprender a desarrollar un sitio Web con PHP y MySQL

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

24/4/2014 ENI Training - Libro online<br />

Por ejemplo:<br />

<br />

Da como resultado:<br />

Array ( [se<strong>con</strong>ds] => 37 [minutes] => 48 [hours] => 10 [mday] => 15 [wday] => 3 [mon]<br />

=> 6 [year] => 2011 [yday] => 165 [weekday] => Wednesday [month] => J<strong>un</strong>e [0] =><br />

1308127717 )<br />

Por tanto, su sintaxis es:<br />

$tabla = getdate()<br />

La f<strong>un</strong>ción checkdate() indica si <strong>un</strong>a fecha es válida o no. Esta f<strong>un</strong>ción tiene en cuenta los<br />

años bisiestos. Toma como parámetros el mes, el día y el año, y devuelve verdadero o falso.<br />

Por ejemplo:<br />

<br />

Da como resultado:<br />

La fecha no es válida<br />

De hecho, no existe el decimotercer mes.<br />

Por tanto, su sintaxis es:<br />

$valido = checkdate($mes,$día,$año)<br />

La f<strong>un</strong>ción strtotime() permite <strong>con</strong>vertir <strong>un</strong> texto en inglés en timestamp, por tanto en<br />

fecha.<br />

Por ejemplo:<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!