- Back to Home »
- PHP Training in Chandigarh
Posted by : CBitss Technologies
Tuesday, 27 February 2018
PHP Training in Chandigarh
PHP is server side scripting language and stands for Hypertext preprocessor like ASP.PHP
scripts are executed on the server.It supports many databases(Mysql,informix,oracle,
sybase,solid,postgreSQL,Generic,ODBC etc) It is an open source software and and it is
free to use and download.
scripts are executed on the server.It supports many databases(Mysql,informix,oracle,
sybase,solid,postgreSQL,Generic,ODBC etc) It is an open source software and and it is
free to use and download.
Loops in PHP :
In computer programming, a loop is a order of directions that is frequently restate until
a certain condition is reached. Typically, a certain process is done, such as getting an item
of data and changing it, and then some condition is checked such as whether a counter
has reached a prescribed number.
a certain condition is reached. Typically, a certain process is done, such as getting an item
of data and changing it, and then some condition is checked such as whether a counter
has reached a prescribed number.
Loops in PHP are used to perform the same block of code described number of times.PHP
support four types of loops-
support four types of loops-
While Loop : The while loop executes a block of code while a condition is true .
Do….while : Loops via a block of code once,and then restate the loop as long as a identify
condition is true.
condition is true.
for...Loop : Loops through a block of code a specified number of times.
foreach Loop : Loops through a block of codes for each element in an array.
PHP statements :
Regularly when we write code, we desire to execute dissimilar activities for dissimilar conditions.
We can use conditional statements in our code to do this.In PHP we have the following
conditional statements:
We can use conditional statements in our code to do this.In PHP we have the following
conditional statements:
if statement : executes some code if one condition is true
if...else statement : implement any code if a case is true and other code if that case is false
if...elseif....else statement : executes different codes for more than two conditions
switch statement : selects one of many blocks of code to be executed
PHP simple statements follow these rules :
- PHP statements end with a semicolon or the PHP end tag
- PHP statements may be written in either uppercase - or lowercase .
Now we discuss the statements with the PHP Training in Chandigarh :
Break and Continue statement with loop :
The continue/break statements are used inside the body of for or while loop. And when these
statements are executed ,they alter the flow of execution.In both cases ,if the current loop is
nested inside another loop,only the innermost loop is affected.
statements are executed ,they alter the flow of execution.In both cases ,if the current loop is
nested inside another loop,only the innermost loop is affected.
PHP Break Statement :
PHP break key helps to finish looping in PHP programming. When a loop faces break key in its
body, it finish its execution immediately. So, be aware to utilize break key center a PHP
Conditional Statement otherwise the loop body will execute no more.
body, it finish its execution immediately. So, be aware to utilize break key center a PHP
Conditional Statement otherwise the loop body will execute no more.
PHP Continue Statement :
The continue statement begin a new loop without perform present loop body. When a loop
finds continue keyword in its body, it stops the body execution and restarts the loop. So, be careful
to use the continue keyword inside a conditional statement otherwise loop body will not be executed.
finds continue keyword in its body, it stops the body execution and restarts the loop. So, be careful
to use the continue keyword inside a conditional statement otherwise loop body will not be executed.
PHP goto Statement :
The goto statement advice to fall one execution label to another execution label. So, if you wish to
fall your program to a labeled statement, we can use goto statement. Say, you require to offer more
instructions for admin user and less information for other users. You can use goto statement to solve
this problem.
fall your program to a labeled statement, we can use goto statement. Say, you require to offer more
instructions for admin user and less information for other users. You can use goto statement to solve
this problem.
If you want to learn more about Loops and statements,then join the
PHP Training in Chandigarh at CBitss Technologies Sector 34A.
