[thelist] PHP Doubling up

Luther, Ron Ron.Luther at hp.com
Wed Aug 14 09:04:01 CDT 2002


Hi Andrew,

[I'm not Rich ... but I might have played him on tv.]

Yeah - that's what he's saying.

Rob's post explains that the "+=" operator appends the value from the
right rather than assigns it.

So,

"total = total + new_value"

would be okay or

"total += new_value "

would be okay.

But the "total += total + new_value" is actually equivalent to

"total = total + total + new_value"

which is where the "doubling up" comes in and is probably not what you want.


HTH,


RonL.

-----Original Message-----
From: Andrew Maynes [mailto:andrew at humanbehaviour.co.uk]

Rich are you just saying take out the second $total ?




More information about the thelist mailing list