Hello World Program PHP Essential Training

Hello World Program PHP Essential Training

PHP

Hello World Program PHP Essential Training

Welcome to another fun and effective tutorial in PHP Essential Training series. Obviously all the programming language tutorials are begins with hello world Program. And here we also too do that but with some extra ideas and shows you the PHP is how simple. In this Hello World Program PHP Essential Training we're gonna see the variables and display the results on the browser as static value. From my personal experience really the PHP is a user friendly and more flexible with any of the front end you're going to use like, Bootstrap, WordPress, Joomla and etc.
Lets jump into the PHP world to taste its all essentials from the bottom of the root. As usual to code a Php open your favorite code editor and put the basic html tags like we did in our first lesson.
<!DOCTYPE html>
<html>
<head>
<title>Hello World Program PHP Essential Training</title>
</head>
<body>
</body>
</html>
As like as other languages PHP doesn't require any data types to define our values. Like we did in Java, C++ or another programming languages. It assumes the data type itslef when we save some data on the variable. If you want to tell it what type of data you want to save then we can mention like decima, float or double. Hello World Program PHP Essential Training is never end with out the HELLO WORLD result. So here we can see how to bring it on the screen.
To begin learning a PHP is very simple. You just know how to start and end the PHP script like we did for begin other script languages with <script> tags. Here we use <?php for begin the PHP scripting language, and ?> for end the scripting language. Whenever we put the <?php the browser automatically understand how to render the following code until find the ?> end of the PHP scripting language.
//Various stages of the variables
//Variable Declaration
$var1;
//Variable Initializaion - Giving an Initial to the variable
$var1 = 10;
//Variable Update - Change the value of the variable
$var1 = $var2
Now lets take a look at how to display the values in the browser.
//Define a variable value and display on the screen
$var = 10;
echo $var;
Hello World Program PHP Essential Training
//Combine a normal echo value and a variable
$var1 = "Androidhotspot.com";
//Add . between the variables, then it'll merge the two things like below.
echo "Welcome " . $var1;
Output
Hello World Program PHP Essential Training
We hope this Hello World Program PHP Essential Training will helpful to start up your knowledge in PHP development. Post your Comments if you have any regarding the above lesson.
Final Code
<!DOCTYPE html>
<html>
<head>
<title>Hello World Program PHP Essential Training</title>
</head>
<body>
//Define a variable value and display on the screen
$var = 10;
echo $var;
//Combine a normal echo value and a variable
$var1 = "Androidhotspot.com";
//Add . between the variables, then it'll merge the two things like below.
echo "Welcome " . $var1;
</body>
</html>
Hello World Program PHP Essential Training
This lesson will gives you an basic knowledge about the display the data on the screen
Download the source Code of Hello World Programming PHP Essential Training from here.

Leave a Reply