Home  >  Article  >  Backend Development  >  What is the difference between echo and print in php

What is the difference between echo and print in php

王林
王林forward
2020-01-19 17:45:372696browse

What is the difference between echo and print in php

1. The difference between the two

echo supports multiple string output, separated by commas (,), print only supports one string output;

echo output speed is faster than print;

echo has no return value, and the return value of print is always 1.

Free learning video tutorial sharing: php video tutorial

2. Use

echo is a language structure function, which can be used with (), or No parentheses are required.

For example:

echo ("这是一个字符串输出");
echo "这是一个字符串输出";

The usage of print is the same as echo.

Recommended related articles and tutorials: php tutorial

The above is the detailed content of What is the difference between echo and print in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete