- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
echo() function in PHP
The echo() function outputs one or more strings.
Note − echo() function is faster than print().
Syntax
echo(str)
Parameters
str − string to be sent to the output
Return
The echo() function returns nothing.
Example
The following is an example: −
<?php echo "Welcome!"; ?>
Output
Welcome!
Example
Let us see another example −
<?php $str1 = "Welcome!"; $str2 = "This is our website!"; echo $str1 . " " . $str2; ?>
Output
Welcome! This is our website!
Example
Let us see another example −
<?php echo "This demo text is on multiple lines."; ?>
Output
This demo text is on multiple lines.
Advertisements