PHP Example PHP

PHP Example  

PHP Example

PHP Example

It is very easy to create a simple PHP example. To do so, create a file and write HTML tags + PHP code and save this file with .php extension.

All PHP code goes between php tag. A syntax of PHP tag is given below:

  1. <?php   
  2. //your code here  
  3. ?>  

Let's see a simple PHP example where we are writing some text using PHP echo command.

File: first.php

  1. <!DOCTYPE>  
  2. <html>  
  3. <body>  
  4. <?php  
  5. echo "<h2>Hello First PHP</h2>";  
  6. ?>  
  7. </body>  
  8. </html>  


Hello First PHP

Download free E-book of PHP

Learn Programming for Free

Join Programmers Community on Telegram

Talk with Experienced Programmers

Just drop a message, we will solve your queries