Home  >  Article  >  Backend Development  >  PHP string concatenation

PHP string concatenation

巴扎黑
巴扎黑Original
2018-05-15 15:10:3827425browse

In Java, we usually use '+' to connect strings. In PHP, we use '.' to connect strings.

Recommended manual: php complete self-study manual

Php code

<?php  
$i=&#39;I&#39;;  
$love=&#39; Love&#39;;  
$you=&#39; You&#39;;  
//连接一下三个字符串  
echo $i.$love.$you;  
?>

The output result is: I Love You

Recommended related articles:
1.What is the string concatenation operator in php?
2.Comparison of the efficiency of several string concatenations in php
Related video recommendations:
1.Dugu Jiujian (4)_PHP Video tutorial
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn