w3reference home
PHP Tutorial


Bookmark and Share

PHP Output

To display the result of a PHP script, there are two basic commands. They are echo and print. Both these commands are used in PHP to display any text. The only difference between these two commands is that print() function is slower than echo() function. Hence, echo has an upper hand and is used more. Let's understand both these functions with the help of examples.

echo function

Let's see an example below to display the text, "My first PHP program!".
<html>
<body>
<?php
echo "My first PHP program!";
?>
</body>
</html>
The output will be:
My first PHP program!

print function

The print function is used in a manner similar to echo statement.
<html>
<body>
<?php
print (My first PHP program!);
print "My first PHP program!";
?>
</body>
</html>
The output will be:
My first PHP program!
My first PHP program!
Code Validator
Learn FTP
Color finder
Link Checker
Free web designs
Coming soon!
Interview Questions...
'w3reference : Learn by examples ... Advanced to beginner's tutorials ...'
Ajax: AJAX tutorial1 | Apache: Apache HTTP Server | Restarting Apache | CSS: CSS Border | CSS Syntax | CSS Selector | CSS Comment | CVS: CVS Release | CVS Login | CVS Logout | CVS Annotate | Databases: Rolap Tutorial | OLAP Tutorial | OLTP Tutorial | data warehousing | Expect: HTML: html | Linux: Dot (.) conf files | Linux Mount Point | Linux Filesystem | SSH Tutorial | Linux Commands: cal | cat | cfdisk | chroot | MySQL: MySQL Commands | PHP: PHP Basics | PHP Variables | PHP Output (echo/print) | PHP String Concat | PL/SQL: PL/SQL Data Types | PL/SQL Control Structures | PL/SQL File Extensions | PL/SQL DBMS_OUTPUT package | Python: My first Python program | Shell: Starting Bash | Bash Redirection | Bash Pipes | Bash Variables | SQL: SQL Transactions | SQL Constraints | SQL Drop | SQL Union & Union All | SVN: svn architecture | SVN Repository | SVN Import | SVN Checkout | Tech: soap | Web Designing: Web Hosting | HTML/XHTML/CSS code validator | Learn FTP | Search Engine Optimization Tips | www: XML: XML vs HTML | XML Syntax | XML Tags, Elements and Attributes | XML Namespaces |
Sitemap | Disclaim | Privacy Policy | Contact | ©2007-2009 w3reference.com All Rights Reserved.