0
how to add PHP code in HTML??
7 Answers
+ 1
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test Site</title>
</head>
<body>
<?php
$text = "This is a text string.";
$num = 5;
$text2 = "This is another text line that display the number: ";
?>
<p><?php echo $text; ?></p>
<p><?php echo $text2, $num; ?></p>
</body>
</html>
0
insert between <?php and ?> tags
0
could u please give a short example..?
0
thnks..👍
0
In your .html file <?php write php code here.. ?>
0
the , is wrong you need a . between $text2.$num
0
Use .HTML extension