<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/language.operators.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'language.operators.string.php',
    1 => 'String',
    2 => 'String Operators',
  ),
  'up' => 
  array (
    0 => 'language.operators.php',
    1 => 'Operators',
  ),
  'prev' => 
  array (
    0 => 'language.operators.logical.php',
    1 => 'Logic',
  ),
  'next' => 
  array (
    0 => 'language.operators.array.php',
    1 => 'Array',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/operators/string.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="language.operators.string" class="sect1">
 <h2 class="title">String Operators</h2>
 
 <p class="simpara">
  There are two <span class="type"><a href="language.types.string.php" class="type string">string</a></span> operators. The first is the
  concatenation operator (&#039;.&#039;), which returns the concatenation of its
  right and left arguments. The second is the concatenating assignment
  operator (&#039;<code class="literal">.=</code>&#039;), which appends the argument on the right side to
  the argument on the left side. Please read <a href="language.operators.assignment.php" class="link">Assignment
  Operators</a> for more information.
 </p>

 <p class="para">
  <div class="example" id="example-1">
   <p><strong>Example #1 String Concatenating</strong></p>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$a </span><span style="color: #007700">= </span><span style="color: #DD0000">"Hello "</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$b </span><span style="color: #007700">= </span><span style="color: #0000BB">$a </span><span style="color: #007700">. </span><span style="color: #DD0000">"World!"</span><span style="color: #007700">; </span><span style="color: #FF8000">// now $b contains "Hello World!"<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$b</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$a </span><span style="color: #007700">= </span><span style="color: #DD0000">"Hello "</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$a </span><span style="color: #007700">.= </span><span style="color: #DD0000">"World!"</span><span style="color: #007700">;     </span><span style="color: #FF8000">// now $a contains "Hello World!"<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </p>

 <div class="sect2">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><a href="language.types.string.php" class="link">String type</a></li>
    <li><a href="ref.strings.php" class="link">String functions</a></li>
   </ul>
  </p>
 </div>
</div><?php manual_footer($setup); ?>