When developing a web application with PHP, we frequently need to print or echo a few HTML results. This work can be accomplished in a variety of ways. Here are a few examples of methods:
Using “echo or print”:– HTML markup, javascript, text, and variables may all be shown with PHP echo or print.
Example 1: This example uses PHP echo to display the result.
Output:-

Example 2: This example uses PHP print to display the result.
Output :

Using echo shorthand or separating HTML: Any expression, variable value, or HTML markup can be shown with the PHP echo shortcut.
Example 1: This example uses PHP echo shorthand to display the result.
Output:

Example 2: Separating HTML from PHP
Output:-

- Top 10 DevOps Trainers in the world - October 7, 2023
- What is Cookies and Why it is Used? - May 24, 2023
- TOP trends of transitions in TikTok - May 10, 2023