How to use HTML tags in PHP echo statement
Notes:
How to use HTML tags in PHP echo statement:
PHP files can have HTML code as well as PHP scripts; i.e. we can write HTML code directly inside a PHP file.
We can also generate desired HTML structure using PHP scripts dynamically; i.e. we can insert HTML tags in between double quotations as part of the PHP strings to generate desired html structure.
Example Code:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
Default page
</title>
</head>
<body>
Hello <strong>World</strong> <br/>
Hello <i>World</i> <br/>
Hello World <br/>
Hello World <br/>
<br/>
<?php
echo "Hello <strong>World</strong> <br/>";
echo "Hello <i>World</i> <br/>";
echo "Hello World <br/>";
echo "Hello World <br/>";
echo "<br/>";
?>
</body>
</html>
Interview Questions:
1. PHP stands for ______________
a. Hypertext Preprocessor
b. Preprocessor Hypertext
c. Personal Home Processor
d. Personal Hypertext processor
Ans: a