search
HomeBackend DevelopmentPHP ProblemWhat is the difference between echo and print in php

What is the difference between echo and print in php

Jan 19, 2020 pm 05:45 PM
echophpprintthe difference

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:博客园. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment