How to Display Text From PHP

Now we will explain how to display some of the text using PHP, yes now you can put some text what you want to display in this file. Just put text text in your PHP file much as you would an HTML page, as here , where you will put an html tags like h1, h2 or h3 header tags and some text into a page.

Example code:

————————————–Code Start here————————————-



<title>Display some text from PHP</title>


<body> <h1>Welcome to The webextensionline </h1>

Here’s  what PHP  has to say:

<br> </br>


echo “Welcome to webextensionline PHP Tutorials”;




————————————--Code End  here————————————-

Now save this php file in to your local server path like in your htdocs with name as  displaytext.php Start your XAMMP and run this file in your localhost server. in your briwser can see the text that php inserted in to the page in the below image. Example: This php file will print the below out put

Out Put:


Welcome to The webextensionline

Here’s what PHP has to say: 

Welcome to webextensionline PHP Tutorials   You will see the output of this PHP file in your localhost browser like below image when you run this file in the localhost server:

PHP File Display Text

PHP File Display Text

By using PHP we can display text in Header tags and an HTML mixing.

You must be logged in to post a comment Login