Home » PHP echo() function

PHP echo() function

by Online Tutorials Library

PHP echo() Function

PHP echo() function is important string function. It is used to display one or more strings. In another words we can say that the echo() function outputs one or more string.

Note: The echo() function is a little faster than print().

Syntax:

Parameter Description Required/Optional
strings Specify one or more strings required

Example 1

Output:

By using 'echo()' function your string is :Hello TutorAspire 

Example 2

Output:

By using 'echo()' function your string is :Hello JAVA  Hello TutorAspire 

Example 3

Output:

Your Shirt color is : Red  

Note: The shortcut syntax only works with the short_open_tag configuration setting enabled.

Example 4

Output:

Your number value is: (1 + 2)  By using 'echo()' function: Addition value is: 3  

Example 5

Output:

Hello John Doe!  

Example 6

Output:

Your string is : 'This ','string ','was ','made ','with multiple parameters.'  This string was made with multiple parameters.  

Example 7

Output:

Peter is 35 years old.  

Next TopicPHP String

You may also like