File: string.xml

package info (click to toggle)
php-doc 20250827~git.abe740d%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 71,968 kB
  • sloc: xml: 985,760; php: 25,504; javascript: 671; sh: 177; makefile: 37
file content (43 lines) | stat: -rw-r--r-- 1,202 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?xml version="1.0" encoding="utf-8"?>
<sect1 xml:id="language.operators.string">
 <title>String Operators</title>
 <titleabbrev>String</titleabbrev>
 <simpara>
  There are two <type>string</type> operators. The first is the
  concatenation operator ('.'), which returns the concatenation of its
  right and left arguments. The second is the concatenating assignment
  operator ('<literal>.=</literal>'), which appends the argument on the right side to
  the argument on the left side. Please read <link
  linkend="language.operators.assignment">Assignment
  Operators</link> for more information.
 </simpara>

 <para>
  <example>
   <title>String Concatenating</title>
   <programlisting role="php">
<![CDATA[
<?php
$a = "Hello ";
$b = $a . "World!"; // now $b contains "Hello World!"
var_dump($b);

$a = "Hello ";
$a .= "World!";     // now $a contains "Hello World!"
var_dump($a);
?>
]]>
   </programlisting>
  </example>
 </para>

 <sect2 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><link linkend="language.types.string">String type</link></member>
    <member><link linkend="ref.strings">String functions</link></member>
   </simplelist>
  </para>
 </sect2>
</sect1>