|
Posted by Zareef Ahmed on 02/10/05 04:50
On Wed, 09 Feb 2005 18:15:28 -0800 (PST), Pagongski
<dante@mail.telepac.pt> wrote:
>
> Hi,
>
> I looked everywhere for a nice explanation of this darn simple thing, but had no luck. I am working with some code made by a different person thats why i am running into these sorts of things. (yes, i am kinda newbie)
> I have a file named "blah.php" with this line:
>
> $B->var1 = "name1";
>
> Then i have another file called "result.php" that has:
>
> require_once("blah.php");
>
> And then i want some code to display the "name1". The problem is i have no idea how to deal with that "->", what it means (object of some sort?) and how to get the value of that variable. Doing print ($var1) obviously doesnt work.
> Can someone please explain this to me? What does the "->" do? How to solve that problem above?
-> operator used to accsses the method and properties of an object
Here B is an object and var1 is an member variable.
do a
print_r($B->var1);
or
print_r ($B);
You will get the all information about this object like class name etc.
zareef ahmed
>
> Big thanks.
>
> Pag
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net
Navigation:
[Reply to this message]
|