Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the link character and how to use it in php

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what is the link in php and how to use it". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the link in php and how to use it".

In php, a link refers to the symbol of a linked string, which is used to concatenate characters and can concatenate two or more strings into a new string. There are two kinds of PHP linkers: 1. The connector is just a simple concatenation string; 2, the ". =" operator, which can be spliced and assigned, can append the string (variable) on the right to the left.

Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

In php, a link refers to the symbol of a linked string, which is used to concatenate characters and can concatenate two or more strings into a new string.

For example, put the following two strings:

$str1= "hello"; $str2= "world"

Concatenate into a string:

Helloworld

There are two types of PHP linkers:

"." Connector

". =" operator

1. Connector

Is a simple concatenation string, syntax:

String1.string2.string3. .stringN

The operation in the above example can be as follows:

$str1= "hello"; $str2= "world"; $str=$str1.$str2;echo $str

You can also add a delimiter between two strings

Echo $str1. ". $str2;echo $str1." -. $str2

2. ". =" operator

". =" is an assignment operator that appends the string (variable) to the right of the operator to the left to form a new value and then assign it to the left. Syntax:

$string = string1;$string. = string2;$string. = string3; $string. = stringN

The operator ". =" is more convenient to concatenate two strings, but it is not good to concatenate more than one string at a time. Fu.

Example:

$str1= "hello"; $str2= "world"; $str1.=$str2;echo $str1

When you concatenate two strings with the ". =" operator, you cannot add a delimiter in the middle.

Thank you for reading, the above is the content of "what is the link in php and how to use it". After the study of this article, I believe you have a deeper understanding of what the link in php is and how to use it, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report