Home > Article > Backend Development > echo() function in PHP
The echo() function outputs one or more strings.
Note - echo() function is faster than print() function.
echo(str)
str − The string to send to the output
The echo() function does not return anything.
The following is an example: −
Online Demonstration
<?php echo "Welcome!"; ?>
Welcome!
Let us see another example −
Live Demo
<?php $str1 = "Welcome!"; $str2 = "This is our website!"; echo $str1 . " " . $str2; ?>
Welcome! This is our website!
Let us see another example −
Live Demo
<?php echo "This demo text is on multiple lines."; ?>
This demo text is on multiple lines.
The above is the detailed content of echo() function in PHP. For more information, please follow other related articles on the PHP Chinese website!