Home  >  Article  >  Backend Development  >  PHP little knowledge

PHP little knowledge

WBOY
WBOYOriginal
2016-08-08 09:21:37806browse

The small difference between include and require
include is inclusion. If the specified file cannot be located, the code will continue to run.
require is necessary, but when using require, if the specified file is not found, the code will stop running and throw a fatal error.
In both cases, an error will be reported when the file is not found, but only the require statement will completely terminate the execution of the code.
echo and print
print returns 1 when the output is completed and only supports one parameter, while echo supports multiple parameters.
echo can also be combined with PHP short tag and equal sign =, as long as short_open_tag is set to on, but the default is off,

Single quotes and double quotes quote strings
Because variables in single quotes will not be parsed, for example
echo '$abc';
echo "$abc";
Otherwise use the string concatenation operator.
echo 'The first name of the '.$abc.'and his last name is'.$lname;
var_dump function to print output, because it can get more output information than using echo or print.

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above has introduced the basic knowledge of PHP, including some aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

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