note 88827 added to language.operators.string
| From: | hexidecimalgadget at hotmail dot com | Date: | Tue, 10 Feb 2009 05:37:33 +0000 |
| Subject: | note 88827 added to language.operators.string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-150437@lists.php.net to get a copy of this message | ||
If you attempt to add numbers with a concatenation operator, your result will be the result of those
numbers as strings.
<?php
echo "thr"."ee"; //prints the string "three"
echo "twe" . "lve"; //prints the string "twelve"
echo 1 . 2; //prints the string "12"
echo 1.2; //prints the number 1.2
echo 1+2; //prints the number 3
?>
----
Server IP: 208.69.120.35
Probable Submitter: 97.113.68.128
----
Manual Page -- http://www.php.net/manual/en/language.operators.string.php
Edit -- https://master.php.net/note/edit/88827
Del: integrated -- https://master.php.net/note/delete/88827/integrated
Del: useless -- https://master.php.net/note/delete/88827/useless
Del: bad code -- https://master.php.net/note/delete/88827/bad+code
Del: spam -- https://master.php.net/note/delete/88827/spam
Del: non-english -- https://master.php.net/note/delete/88827/non-english
Del: in docs -- https://master.php.net/note/delete/88827/in+docs
Del: other reasons-- https://master.php.net/note/delete/88827
Reject -- https://master.php.net/note/reject/88827
Search -- https://master.php.net/manage/user-notes.php