PHP中的echo()函数

PhpPhp 2023-09-01 04:42:43 894
摘要: echo()函数输出一个或多个字符串。注意-echo()函数比print()函数更快。语法echo(str)参数str−要发送到输出的字符串返回值echo()函数不返回任何内容。示例以下是一个示例:−在线演示<?phpecho"We...

PHP中的echo()函数

echo()函数输出一个或多个字符串。

注意 - echo()函数比print()函数更快。

语法

echo(str)

参数

  • str − 要发送到输出的字符串

返回值

echo()函数不返回任何内容。

示例

以下是一个示例:−

在线演示

<?php
   echo "Welcome!";
?>

输出

Welcome!

Example

Let us see another example −

Live Demo

<?php
   $str1 = "Welcome!";
   $str2 = "This is our website!";
   echo $str1 . " " . $str2;
?>

输出

Welcome! This is our website!

Example

Let us see another example −

Live Demo

<?php
   echo "This demo
   text is on
   multiple
   lines.";
?>

输出

This demo text is on multiple lines.

以上就是PHP中的echo()函数的详细内容,更多请关注其它相关文章!