The PHP echo Statement | How To Use echo Statement In Php

Hi, Guys today I am going to teach you how to use echo statement in PHP so if you want to learn PHP with scratch. So let's Begin.

How To Use echo Statement In Php

The PHP echo Statement

So here is an example of the Php echo command With Html tags and CSS.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html language="en">
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
        <title><?php echo"My 1st PHP Title" ?></title>
    </head>
    <body>
        <h1><?php echo"My PHP Heading"; ?></h1>
        
        <?php 
        // DO With Html Tags in php
        echo"<h4>H4 With PHp</h4>"; 
        
        // Do With CSS In Php
        echo"<p style='color:red;'>Trying With Css</P>";
        
       // Do With Css And Html Tags
        echo"<p style='color:blue;'><b>Trying With Css + Bold</b></P>";
        
       // Do With Number in PHP
        echo 415+5;
        ?>
        
    </body>
</html>

Use of Php echo Statement

Using of Php echo Statement is very simple and helpful for your website. 
  • For Display text.
  • Display Number
  • Display variable
So I hope this is helpful for you, Thanks for reading this article. 

Post a Comment

0 Comments