note 93929 added to language.operators.precedence
| From: | PatrykBratkowski at osu1 dot php dot net | Date: | Wed, 07 Oct 2009 02:18:17 +0000 |
| Subject: | note 93929 added to language.operators.precedence | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161425@lists.php.net to get a copy of this message | ||
Please note that certain operators change the variable type in ways you may not expect.
If you want to append the result of an arithmetic operation to a string you have to do it in two
steps:
<?php
$ord = $i + 1;
$field = "cellID" . $ord; // returns a string
$field = "cellID" . $i + 1; // because of the addition it returns an int
?>
----
Server IP: 64.71.164.2
Probable Submitter: 189.239.89.7
----
Manual Page -- http://www.php.net/manual/en/language.operators.precedence.php
Edit -- https://master.php.net/note/edit/93929
Del: integrated -- https://master.php.net/note/delete/93929/integrated
Del: useless -- https://master.php.net/note/delete/93929/useless
Del: bad code -- https://master.php.net/note/delete/93929/bad+code
Del: spam -- https://master.php.net/note/delete/93929/spam
Del: non-english -- https://master.php.net/note/delete/93929/non-english
Del: in docs -- https://master.php.net/note/delete/93929/in+docs
Del: other reasons-- https://master.php.net/note/delete/93929
Reject -- https://master.php.net/note/reject/93929
Search -- https://master.php.net/manage/user-notes.php