← CodePrimer
PHP Beginner Basics

Embed PHP inside HTML

How do I mix PHP and HTML?

<?php ?> blocks.

Sample
<!DOCTYPE html>
<html>
<body>
  <h1><?php echo 'Hello from PHP'; ?></h1>
</body>
</html>

Notes

Every PHP statement ends with a semicolon.

Keywords: php tags · embed · html · semicolon

Related

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share