Answers for "php file in html"

PHP
9

php include html

<body>
<?php 
    define('ROOT_PATH', dirname(__DIR__).'/');
    include ROOT_PATH.'header.php';
    include ROOT_PATH.'main.php';
    include ROOT_PATH.'footer.php';
?>
</body>
Posted by: Guest on September-05-2021
1

inline php in html

<body>
Hello, today is <?php echo date('l, F jS, Y'); ?>.
</body>
Posted by: Guest on May-04-2020
0

can i write php code in html file

<div>
  <?php echo "This is printed by PHP"; ?>
</div>

<div> 
	<?php $sum = 5+2; echo $sum; ?>
 </div>
Posted by: Guest on May-24-2021

Browse Popular Code Answers by Language