note 106437 added to language.operators.string

From: Date: Wed, 09 Nov 2011 12:38:35 +0000
Subject: note 106437 added to language.operators.string
Groups: php.notes 
Request: Send a blank email to php-notes+get-184352@lists.php.net to get a copy of this message
Note that the concatenation operator (.=) needs a specified variable on both sides. If you are running a loop to read out a list of items from $table (this, is, my, list) <?php $surface .= $table; ?> will give you ".this is my list". To get rid of the initial dot, you need to specify an empty $surface first: <?php $surface=''; $surface .= $table; ?> giving "this is my list". (php 5.2.3-1ubuntu4.5) ---- Server IP: 92.48.74.199 Probable Submitter: 86.149.109.213 ---- Manual Page -- http://www.php.net/manual/en/language.operators.string.php Edit -- https://master.php.net/note/edit/106437 Del: integrated -- https://master.php.net/note/delete/106437/integrated Del: useless -- https://master.php.net/note/delete/106437/useless Del: bad code -- https://master.php.net/note/delete/106437/bad+code Del: spam -- https://master.php.net/note/delete/106437/spam Del: non-english -- https://master.php.net/note/delete/106437/non-english Del: in docs -- https://master.php.net/note/delete/106437/in+docs Del: other reasons-- https://master.php.net/note/delete/106437 Reject -- https://master.php.net/note/reject/106437 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#184352) next »