How to learn basic php
Today I will discuss on basic php programming.
When a visitor visit a website documents using a Browser, the
Browser reads the HTML source code and depend on the html markup contained there, creates a page and displays
it in the visitors Browser window, thus giving the web site a specific look and feel.
How to get started with php?
Writing PHP doesn't required any software tool, only you need text editor(i.e. pure ASCII editors) like Notepad in
Windows or Kate in Linux .But to run php script you must have to install software tool.
How to give name of php file?
In order to save a PHP script the filename must end with .php, better is to use all small letters.
How to comment into php script?
If you want to comment for indication of funcations or varibales in php script you can embeded commet tag within
code describing what the php code doing.
Comments will help you to understand the code when maintaining it at a later date.It is also great if a team is
working on a single project and another member could understand your code.
Syntax of php comment:
Step No.1: //at the beginning of each line (i.e. a single line comment)
Step No.2: /* .......... */ to comment out several lines (i.e. a multi line comment)
Step No.3: #at the beginning of each line (i.e. single line comment)
How to show a output or text with php script?
To show a output text in a PHP script on Browser the commands print or echo can be used.
The print statement is used in the following way:
print ("Show The Message");
print is the php script command which order the PHP interpreter what to do.
Now lets create our first php sample page within HTML:(myfirstpage.php)
Your first basic php page is ready.

Browser reads the HTML source code and depend on the html markup contained there, creates a page and displays
it in the visitors Browser window, thus giving the web site a specific look and feel.
How to get started with php?
Writing PHP doesn't required any software tool, only you need text editor(i.e. pure ASCII editors) like Notepad in
Windows or Kate in Linux .But to run php script you must have to install software tool.
How to give name of php file?
In order to save a PHP script the filename must end with .php, better is to use all small letters.
How to comment into php script?
If you want to comment for indication of funcations or varibales in php script you can embeded commet tag within
code describing what the php code doing.
Comments will help you to understand the code when maintaining it at a later date.It is also great if a team is
working on a single project and another member could understand your code.
Syntax of php comment:
Step No.1: //at the beginning of each line (i.e. a single line comment)
Step No.2: /* .......... */ to comment out several lines (i.e. a multi line comment)
Step No.3: #at the beginning of each line (i.e. single line comment)
How to show a output or text with php script?
To show a output text in a PHP script on Browser the commands print or echo can be used.
The print statement is used in the following way:
print ("Show The Message");
print is the php script command which order the PHP interpreter what to do.
Now lets create our first php sample page within HTML:(myfirstpage.php)
Your first basic php page is ready.
How to learn basic php
Reviewed by Abdul Moid
on
October 29, 2015
Rating:
