PHP HTML Embeddedness program.
<html>
<head>
<title>Web Page title is to written here.</title>
</head>
<body>
<h2>Welcome to our website!</h2>
<?php
$name = "John";
$course = "PHP";
?>
<p>Hello <?php echo $name; ?>,
<p>Try this basic <?php echo $course; ?> example.</p>
</body>
</html>
Program to check PHP configuration settings.
Single line comment example in PHP
<?php
// This is C++ style one line comment in PHP.
echo 'PHP single line comment example';
?>
Multiline comment example in PHP
<?php
/* This is a
multi line
comment supported
in PHP
*/
echo 'PHP multiline comments example';
?>
Example to add HTML element inside PHP
<html>
<head>
<title>Web Page title is to written here.</title>
</head>
<body>
<h2>Welcome to our website.</h2>
<?php
$name = "John";
$course = "PHP";
echo '<p>Hello '.$name.',<br/>';
echo 'Try this basic '.$course.' example</p>';
?>
</body>
</html>
Program to echo text using php short open tag.
<html>
<head>
<title>Web Page title is to written here.</title>
</head>
<body>
<h2>Welcome to our website.</h2>
<?
$name = "John";
$course = "PHP";
echo '<p>Hello '.$name.',</p>';
?>
<p>Try this basic <?= $course ?> example</p>
</body>
</html>