echo()函数输出一个或多个字符串。
注意 - echo()函数比print()函数更快。
语法echo(str)
参数str − 要发送到输出的字符串
返回值echo()函数不返回任何内容。
示例以下是一个示例:−
在线演示
<?php echo "welcome!";?>
输出welcome!
examplelet us see another example −
live demo
<?php $str1 = "welcome!"; $str2 = "this is our website!"; echo $str1 . " " . $str2;?>
输出welcome! this is our website!
examplelet us see another example −
live demo
<?php echo "this demo text is on multiple lines.";?>
输出this demo text is on multiple lines.
以上就是php中的echo()函数的详细内容。