A Basic PHP Program


PHP is a server side language, which means it execute on the server machine and send output to the client machine.

so Server is like a computers which store information on it memory and display data on the machine connected to Internet. This system is setup via assigning a Fixed IP to that machine, so that the file on the machine can executed anywhere in world,

The system we are using will called as client machine, Which ask data from the server machine to display the information on the screen or output device like Printer.

So PHP is sever side languages, which actually create the HTML with some numeric or Theoretical calculation done by the programmer.

so here are a Basic PHP Program , which simply print hello in the webpage.

The PHP start with <?php and end with ?>
This sign tell the server to execute the PHP code between these sign.


The Following is the code:  (Use spaces and tab, so the programm is easily readable for future reading/ reviewing of the code)


#################################################################
<html>
               <head>
                              A Basic PHP Programm
               </head>

               <body>
                              <?php
                                             echo "Hello.";
                               ?>
               </body>
</html>

#################################################################


The Following will be output on the browser.


#################################################################
Hello.
#################################################################


You can write PHP code various way, Two Popular way is Following:

PHP within HTML Tags:

<h1>
<?php echo "Sum of two and three is as follow:";  ?>
</h1>
<p>
<?php
echo 2+3;
?>
</p>

HTML Tags within PHP:
<?php
echo "<h1>Sum of two and three is as follow:</h1>";
echo "<p>".(2+3)."</p>";
?>



Comments

  1. It is a wonderful data you offered to us I really enjoy by reading your article.
    PHP Training Institute in Chennai
    Best PHP training in chennai

    ReplyDelete
  2. The provided information’s are very useful to me. It’s a wonderful site for learning web application. Thank you for sharing this wonderful blog.
    PHP Course Chennai | PHP course | PHP courses in Chennai | PHP Training in Chennai

    ReplyDelete
  3. Hey Nice Blog!! Thanks For Sharing!!!Wonderful blog & good post.Its really helpful for me, waiting for a more new post. Keep Blogging!
    best java training in coimbatore
    php training in coimbatore
    best php training institutes in coimbatore

    ReplyDelete

Post a Comment

Popular posts from this blog

Page Unload Show Notification to user

Function Oriented File Upload PHP

Upload File Using PHP - Example For Image