PHP 5.2.x output operation details

WBOY
Release: 2016-07-25 08:55:39
Original
955 people have browsed it
  1. $a = "hello";
  2. $b = "world";
  3. echo $a,$b,"
    ";
  4. echo $a.$b."< ;br>";
  5. print $a.$b;
Copy code

output result: helloworld helloworld helloworld

But this will cause a compilation error:

  1. print $a,$b;
Copy code

Note: There is a comma in the middle of $a $b. 2. The difference between single quotes and double quotes:

  1. $a = "hello";
  2. $b = "world";
  3. echo "$a $b";
Copy code

Output: hello world

echo '$a $b'; Then the output is: $a $b

The following can also be output normally:

  1. $arr = array("a" => 1);
  2. echo $arr['a'];
Copy code


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!