Ver Mensaje Individual
  #5 (permalink)  
Antiguo 26/02/2010, 07:43
Avatar de jackson666
jackson666
 
Fecha de Ingreso: noviembre-2009
Ubicación: Buenos Aires, Argentina
Mensajes: 1.971
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: saber si todas las variables por GEt estan vacias

Cita:
Iniciado por abimaelrc Ver Mensaje
Podrías crear un bucle, por ejemplo foreach() y recorrer toda la variable de get y si no llega al final y hay una variable llena modificas algun valor para que indique que hay información.
Código PHP:
Ver original
  1. $bool = true;
  2. foreach($_GET as v){
  3.   if(!empty($v)){
  4.     $bool = false;
  5.   }
  6. }
  7. if($bool){
  8.   echo "todas las variables están vacias.";
  9. }
Ojo! te comiste un '$'

Código PHP:
Ver original
  1. $bool = true;
  2.  
  3. // Aca!
  4. foreach($_GET as $v){
  5.  
  6. // No hay que preguntar si TODAS estan vacias?
  7.   if(!empty($v)){
  8.     $bool = false;
  9.   }
  10. }
  11. if($bool){
  12.   echo "todas las variables están vacias.";
  13. }
__________________
HV Studio
Diseño y desarrollo web