/ Published in: PHP

echo validarFecha( '1-1-1998', 0 ) ? 'ok' : 'ko' ; #ok
echo validarFecha( '1-1-1998' ) ? 'ok' : 'ko' ; #ko
echo validarFecha( '1980/05/06' ) ? 'ok' : 'ko' ; #ok
echo validarFecha( '1700-5-1' ) ? 'ok' : 'ko' ; #ok
echo validarFecha( '1-1-1998' ) ? 'ok' : 'ko' ; #ko
echo validarFecha( '1980/05/06' ) ? 'ok' : 'ko' ; #ok
echo validarFecha( '1700-5-1' ) ? 'ok' : 'ko' ; #ok
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function validarFecha( $fecha, $invertir = 1 ){ else return false; }
Comments
