- 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
print() function in PHP
The print() function in PHP outputs one or more string.
Note − The print() function is slower than echo()
Syntax
print(arg)
Parameters
arg − The input data
Return
The print() function always return 1.
Example
The following is an example −
<?php $s = "This is demo text!"; print $s; ?>
Output
This is demo text!
Example
The following is an example −
<?php $one = "Java is a programming language!"; $two = "James Gosling developed Java!"; $three = "Current version of Java is Java SE 11!"; print $one . " " . $two . " " .$three; ?>
Output
Java is a programming language! James Gosling developed Java! Current version of Java is Java SE 11!
Example
The following is an example −
<?php print "This is a demo text in multiple lines."; ?>
Output
This is a demo text in multiple lines.
Advertisements