PHP/String/String Operators

Материал из Web эксперт
Перейти к: навигация, поиск

String Concatenation Operators

<?php
     $header = "<html>\n"
             . "<head>\n"
             . "<title>String Operators</title>\n"
             . "</head>\n"
             . "<body>\n";
     $body_content = "body<br />\n";
     $footer = "</body>\n"
             . "</html>\n";
     $page_content .= $header . $body_content . $footer;
     print($page_content);
?>



String Operators summary table

Operation                         Operator             Example
String concatenation               .                   $a . $b
String concatenation assignment    .=                  $a .= $b