utahcon Posted April 18, 2006 Share Posted April 18, 2006 Ok I am looking through some code... so I need to know something.I see this in my code[code]$SESSION['variable']->user->ID[/code]Is this calling the user ID for the $SESSION['variable']?Also what does this do[code]$_SESSION['variable']->user->ID as $site_ID => $site_info[/code]Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/7735-what-is-the-operator/ Share on other sites More sharing options...
obsidian Posted April 18, 2006 Share Posted April 18, 2006 ok, the pointer (->) operator is completely different from the "=>" operator. the second is mainly used with arrays. it shows the relationship between a key and its value. for instance, if we were assigning an associative array, we would do something like this:[code]$favorites = array("candy" => "chocolate", "color" => "blue");[/code]this then assigns the value of "chocolate" to $favorites["candy"] and so forth.you use the same operator when you're pulling information OUT of an array:[code]foreach ($favorites as $key => $value) { echo "$key contains \"$value\"<br />\n";}[/code]as for the pointer (->) operator, you need to read up on OOP (Object Oriented Programming) to get a full realization of what all is involved with something like that.hope this helps! Quote Link to comment https://forums.phpfreaks.com/topic/7735-what-is-the-operator/#findComment-28236 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.