PHP string concatenation

巴扎黑
Release: 2023-03-03 12:34:02
Original
27456 people have browsed it

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;  
?>
Copy after login

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
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!