Re: Retrieving values from array on a class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



# lists@xxxxxxxxxxx / 2006-10-14 16:42:37 +0100:
> >     Just like you'd access members of any other array.
> > 
> >     $whatever = $params_file->getMySQLParams();
> >     print($whatever[0]);
> > 
> >     This is a matter of basic rules of the language. Did you know
> >     most of the grammer is described in the manual?

> Sure, i already tried that, but it doesn't works.
> All i get is a blank page.
> 
> BTW, here is my class:
> 
> class returnConfigParams
>  {
> 
>   var $a;
>   var $b;
>   var $c;
>   var $d;
>  	
> 
>   function getMySQLParams()
>    {
>     include($_SERVER['DOCUMENT_ROOT']."/properties.php");
> 	
>     $values = array(0 => $a, 1 => $b, 2 => $c, 3 => $d);
> 	
>     return($values);
> 
>   }
> 
> }

    since you don't say what's in the included file, I'll assume
    it's empty. $a will be unset and print($rCP->getMySQLParams())
    will print nothing ("").

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux