- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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.
- Related Articles
- How to echo XML file in PHP
- What is the difference between echo, print, and print_r in PHP?
- Add PHP variable inside echo statement as href link address?
- How to do bold and simple text in the same line using the echo in php?
- file_exists() function in PHP
- basename( ) function in PHP
- chgrp()function in PHP
- chmod() function in PHP
- chown() function in PHP
- clearstatcache() function in PHP
- copy() function in PHP
- delete() function in PHP
- dirname()function in PHP
- disk_free_space() function in PHP
- disk_total_space() function in PHP

Advertisements