Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/07/2008, 23:43
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 9 meses
Puntos: 2135
Respuesta: ayuda con clase

Sin ondar mucho en el tema tendrías que hacerlo así:
Código PHP:
<?php

class prueba {
public 
$email;
public 
$valor;
public 
$resultado;
function 
__construct($email) {
$this->email $email;
$this->valor filter_var$emailFILTER_VALIDATE_EMAIL );
$this->resultado $resultado;
}

function 
resultado() {

// acá comparo el valor que supuestamente me devolvio filter_vars(...)

if ($this->valor == true) { $this->resultado "bien";}
if (
$this->valor == false) { $this->resultado "mal"; }
return 
$this-> resultado;
}
}


$instancia = new prueba("[email protected]");
echo 
$instancia->resultado();


?>
Saludos.