How to embed PHP code in HTML
For an experienced PHP Web developer, this is a very easy thing to do. But this is a problem for beginners who are just beginning to touch the PHP programming language. So here's how to embed PHP code in regular HTML code.
Embed PHP code in regular HTML
Create a Hello script, named hello.php:
?
1 2 3 4 5 6 7 8 |
PHP Test Hello World ';?> |
In the HTML code above, print Hello in the PHP code. Writing PHP code in HTML requires the use of tags. Integrating PHP and HTML is a very simple thing to do.
We can also write more complex PHP code in HTML, which requires the use of tags.
More advanced Code Examples:
?
1 2 3 4 5 6 |
PHP HTML Integration
|
Output Result:
?
1 2 3 4 5 |
Item No 1 Item No 2 Item No 3 Item No 4 Item No 5 |
The above mentioned is the whole content of this article, I hope you can like.
http://www.bkjia.com/PHPjc/1000089.html www.bkjia.com true http://www.bkjia.com/PHPjc/1000089.html techarticle How to embed PHP code in HTML This is a very easy task for an experienced PHP Web developer. But for beginners who are just beginning to touch the PHP programming language, this is a ...