We can use PHP code between HTML codes .The PHP code must begin with <?php and end with ?> . PHP may insert between HTML tags but you need to specify it . Using this <?php ?> we can separate PHP codes from HTML tags. At executing time server will avoid html tags from execution of the program. If you need to print html tags you can use
Echo " <html Tag here>";
Eg :
<html>
<p><b> This is a html page contain PHP codes </b></>
<img src="somepicture's path"></img>
PHP code begins here
<?php
printf("This is a block of PHP codes");
?>
<b>PHP code ends</b>
</html>
Printf is used to print some charecters in a html page
Echo " <html Tag here>";
Eg :
<html>
<p><b> This is a html page contain PHP codes </b></>
<img src="somepicture's path"></img>
PHP code begins here
<?php
printf("This is a block of PHP codes");
?>
<b>PHP code ends</b>
</html>
Printf is used to print some charecters in a html page
No comments:
Post a Comment