PHP Write your first PHP program

PHP is one of the famous Open Source Language platforms for all those who want to explore their web development expertise.

Below is the first PHP program written in two different ways,
first you can write HTML inside the echo statement
And second we can write echo statement inside HTML. Echo is used to print text on browser page.

There is one notation you might have noticed. “<php” it is starting tag for compiler to compiler PHP and “?>” is the ending tag to end PHP compiler.
Some of them makes simple mistake while writing PHP program is “<?” this notation,  this is not the correct notation. User only “<?php”


Your first PHP Program. 


<!DOCTYPE html>
<html>
<body>
<div>
<?php
echo "<div>My First Outer PHP code!<div><br/>";
?>
<strong><?php echo "My First inner PHP code!"?></strong>
</div>
</body>
</html>

Output of this program

My First Outer PHP code!

My First inner PHP code!



1 comment :

Post a Comment

Leave A Comment...