Home  >  Article  >  Backend Development  >  PHP 5.2.x output operation details

PHP 5.2.x output operation details

WBOY
WBOYOriginal
2016-07-25 08:55:39931browse
  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


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