I believe you would be getting a number echoed to the screen or dumpfile,
but you want the values, correct?

$telefono is declared as an array.  Calling an echo statement on an array
won't give you the values of the array elements.  In order to have them all
printed to screen, try:

foreach ($telefono as $tele) {  // $tele is just a tempo variable, name it
what you want
    print "$telefono<br>\n";      // <br> for screen formatting, \n for
source formatting


"Silvia Mahiques" <[EMAIL PROTECTED]> wrote in message
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

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

I have written too:

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

but is not correct.

Can anybody help me?


Silvia Mahiques

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to