PHP Question
I have program written by someone whom I'm not able to contact. I'm needing to revise this script and I've run into an operator(??) I've never seen before and can't find a reference to it. Here's the snippet of code in question:
$MainContents =& ob_get_contents();
What does the =& mean?
Thanks. Any insights you can provide would be appreciated.
Mark Hensler posted this at 07:03 — 7th February 2002.
He has: 4,048 posts
Joined: Aug 2000
Welcome to TWF, Dami.
That's a reference. I've not used them, so all I can do is point you to the PHP Docs:
Chapter 14. References Explained
Dami posted this at 13:48 — 7th February 2002.
She has: 88 posts
Joined: Sep 2001
Well, I can see that's way beyond my meager abilities. Thanks for the link, Mark. I'd searched there, but obviously not in the right area.
ROB posted this at 23:18 — 10th February 2002.
They have: 447 posts
Joined: Oct 1999
'&' is the bitwise AND operator, bits in both operands are set. any operator trailing a '=' such as +=, *=, %= etc will the left value the result of the operation between left and right value. for instance $a=5; $a*=10; // result is $a = 500.
ROB posted this at 23:30 — 10th February 2002.
They have: 447 posts
Joined: Oct 1999
i now see that it's =& not &=, doh on me.
$MainContents =& ob_get_contents();
assigns a reference to ob_get_contents in $MainContents
Mark Hensler posted this at 23:34 — 10th February 2002.
He has: 4,048 posts
Joined: Aug 2000
Howard, isn't the amp on the wrong side?
Dami posted this at 22:21 — 15th February 2002.
She has: 88 posts
Joined: Sep 2001
Thanks, guys, for the information. Sorry to take so long to acknowledge your comments. 99% of what you said was so over my head. I'll back up and bit and start with smaller steps.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.