Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the difference between php double quotation marks and single quotation marks

Shulou Source: shulou.com Published: 2022-05-31 10:59:48 10月01日 Update

This article introduces the relevant knowledge of "what is the difference between php double quotes and single quotes". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Description

1. Double quotation marks explain variables, while single quotation marks do not explain variables.

2. Insert single quotation marks in double quotation marks. If there is a variable in single quotation marks, then explain the variable.

3. The double quotation mark variable name must be followed by a non-numeric number.

Letters, special underlined characters, or enclose variables in {}, otherwise the following part of the variable name will be taken as a whole, resulting in syntax errors.

4. the efficiency of single quotation marks is higher than that of double quotation marks.

You can make single quote characters use single quotation marks as much as possible.

Example

$echo 'single quotation marks:'. $r.'

'; $r = str_replace ("\ t",',', $s); echo 'double quotes:' .$ r.'

What's the difference between php double quotation marks and single quotation marks? thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Quotation marks variables explanations content characters more knowledge practical special learned next underlining you can make dilemma letters examples actual situation efficiency numbers. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info macOS MariaDB Docker vpn