A basic PHP Program

Here we are going to understand basic PHP program within  a HTML Code.

Follow the program to Understand:

  • Comments on PHP
  • Printing a word using PHP
  • print and echo function in PHP, These function are used for displaying a Text, word or a variable. Some times its also used to display return value from the function, which will be understand later in the Blog.
  • Function are the pre-defined a Block of code, which makes you easy to write program. This is also cover later in the blog.
  • A Browser only display HTML, and server by the use of Apache execute the PHP and makes HTML to display on the Browser. 
  • Some Example of are "Opera", "Google Chrome", "Mozila Firefox".
  • Use as many as Space, Tabs and new line in PHP code. This is called Best Proctise to write a Code in any language, as They are readable and more clear then write withouts spaces and etc.


###############################################
   PHP Code
###############################################
<html>
<head>
<title>Hello world!</title>
</head>

<body>
<?php


/*
Use space , tab and
new line for proper understanding and readable code for future to review

*/

// a basic programm for showing some information on browser

echo "Hello world!"
echo "<br/>";
print "Hello" . "world!";
echo "<br/>";
print 2+3;

// a basic programm for showing some information on browser


// comments are done using following three type:

// single line comments  (one way)
# single line comments   (another way)
/*
multi line comments like this
*/


// comments

?>

</body>

</html>
###############################################

Comments

Popular posts from this blog

Page Unload Show Notification to user

Function Oriented File Upload PHP

Upload File Using PHP - Example For Image