Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • What is procees to print HTML page with tags using PHP ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 100
    Comment on it

    Hello all welcome to findnerd, today we are going to discuss How to print HTML page with tags using PHP ?

    The htmlspecialchars() Function is very useful print HTML page with tags using PHP

    Firstly let know what does htmlspecialchars() Function ?

    The htmlspecialchars() function is used to converting some predefined characters to HTML entities.

    syntex of htmlspecialchars()

      htmlspecialchars();

    You can take reference of bellow example:

    <!DOCTYPE html>
    <html>
    <body>
    <!-- here write a text which you want print in php tag -->
    <h3>This is a new text.</h3>
    
    <?php
    //here $str is a varibale of text
    $str = "Hello Word!";
    //here call htmlspecialchars() to print text
    echo htmlspecialchars("<h1>This is a new text</h1>")."<br>";
    
    //here call htmlspecialchars() to print $str variable
    echo htmlspecialchars($str);
    ?>
    
    </body>
    </html>
    

    Output will come following:

    This is a new text

    Hello Word! 

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: