Turn Your Vehicle Into a Smart Earning Asset

While youโ€™re not driving your car or bike, it can still be working for you. MOTOSHARE helps you earn passive income by connecting your vehicle with trusted renters in your city.

๐Ÿš— You set the rental price
๐Ÿ” Secure bookings with verified renters
๐Ÿ“ Track your vehicle with GPS integration
๐Ÿ’ฐ Start earning within 48 hours

Join as a Partner Today

Itโ€™s simple, safe, and rewarding. Your vehicle. Your rules. Your earnings.

Echo And Print Statements In PHP

What is echo in PHP

This statement is used to output the data to the screen or printing text on screen.

The echo statement can output one or more strings. In general terms, the echo statement can display anything that can be displayed to the browser, such as string, numbers, variables values, the results of expressions, etc.

Since echo is a language construct not actually a function (like if a statement), you can use it without parentheses e.g. echo or echo(). However, if you want to pass more than one parameter to echo, the parameters must not be enclosed within parentheses.

Example:

The output of the above PHP code will look something like this: Devopsschool!

echo with HTML

The following example will show you how to display HTML code using the echo statement:

Example:

The output of the above PHP code will look something like this:

This is a simple heading.

This is heading with style.

Display Variables

The following example will show you how to display variable using the echo statement:

Example:

The output of the above PHP code will look something like this:

Hello Dharmu!
150696
Red

What is print in PHP

You can also use the print statement (an alternative to echo) to display output to the browser. Like echo the print is also a language construct not a real function. So you can also use it without parentheses like: print or print().

Both echo and print statement works exactly the same way except that the print statement can only output one string, and always returns 1. That’s why the echo statement considered marginally faster than the print statement since it doesn’t return any value.

print with HTML

The following example will show you how to display HTML code using the print statement:

The output of the above PHP code will look something like this:

This is a simple heading.

This is heading with style.

Display Variables

The following example will show you how to display variable using the print statement:

Example:

The output of the above PHP code will look something like this:

Hello Dharmu!
123456789
Red

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.