Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/09/2009, 05:03
Avatar de hvpareja
hvpareja
 
Fecha de Ingreso: marzo-2007
Ubicación: En Vélez Málaga (Málaga)
Mensajes: 213
Antigüedad: 17 años, 2 meses
Puntos: 4
Diferencia entre cero y NULL

Amigos...

En mi script PHP tengo algo así (adaptado):

Código PHP:

$a 
$_POST['a']; // a = (int) 0

if(empty($a)){ echo "error"; } 
¡Estoy enviando un cero! ¿Por qué PHP entiende que está vacío? Además, también piensa que no está definido, que es nulo, etc, etc, etc...

¿Qué ignoro?¿Qué hago mal?
__________________
El mejor maestro es el eterno aprendiz.
http://hvpareja.wordpress.com/