How to embed PHP code in HTML, embed PHP
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:
PHP Test<?php Echo 'Hello World
';?>
In the HTML code above, print Hello in the PHP code. Writing PHP code in HTML requires the use of <?php?> 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 <?php tag and end with?> tag.
More advanced Code Examples:
PHP HTML Integration
<?php for ($i =1; $i <=5; $i + +) {?>
- Item No <?php echo $i;?>
<?php}?>
Output Result:
Item no 1Item no 2Item no 3Item no 4Item No 5
The above mentioned is the whole content of this article, I hope you can like.
http://www.bkjia.com/PHPjc/998807.html www.bkjia.com true http://www.bkjia.com/PHPjc/998807.html techarticle How to embed PHP code in HTML, embedded in PHP for an experienced PHP Web developer, this is a very easy thing. But for beginners who are just beginning to touch the PHP programming language ...