On Thu, 29 Jan 2004 12:35:45 -0500, Keith Bowes <do****@spam.me> wrote:
$string += "more information<br>";
doesn't seem to work.
Try:
$string .= "more information<br>";
Yeah, but why didn't they overload the + operator like other languages?
It's a matter of opinion as to whether this:
<pre>
<?php
print "1" + "2";
print "\n";
print "1" . "2";
?>
</pre>
Should output:
3
12
(which it does)
Or:
12
12
Both are reasonable from different points of view; PHP went with the first.
Given that numeric values often come in as strings from $_GET/$_POST, always
doing arithmetic for '+', and having concatenation as a separate operator
probably makes more sense in the majority of cases.
--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>