How to use PHP in HTML ?
In this article, we will use PHP in HTML. There are various methods to integrate PHP and HTML, some of them are discussed below.
You can add PHP tags to your HTML Page. You simply need to enclose the PHP code with the PHP starts tag <?php and the PHP end tag ?>. The code wrapped between these two tags is considered to be PHP code, and it will be executed on the server-side before the requested file is sent to the client browser.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.
Note: To use PHP in HTML, you have to use the .php extension because In PHP the code is interpreted and run on the server-side.
<html> <?php echo "welcome to geeksforgeeks" ?> </html>