I want to set member variables out of their class. The code class is:


class translator {
 var $nombre; 
 var $departamento;
 var $despacho;
 var $telefono;
 var $correo_electronico;
 var $pagina_personal;

 function translator(){ 
  $nombre = array("Nombre","Name");  
  $departamento = array("Departamento","Department");  
  $despacho = array("Despacho","Office");  
  $telefono = array("Teléfono","Phone");
  $correo_electronico = array("Correo Electrónico","E-mail");
  $pagina_personal = array("Página Personal","Personal HomePage");

I access to this class from another php file and want to set this member variable:

$c = new translator();
echo $c->telefono;       /* this member isn't set but in constructor method has been 

I have written too:

echo $c->$telefon;
echo "{$c->telefon}";

but is not correct.

Can anybody help me?


Silvia Mahiques

Reply via email to