PHP Tutorial – PHP Function In this lesson we are going to learn how to create a function in PHP. A function is a block of codes that performs a particular task which can be executed anywhere in the page…
Tag: PHP tutorial
PHP Tutorial – PHP Arrays
PHP Tutorial – PHP Arrays An array is a special variable that can store multiple values in a single variable. The elements of the array are accessed via an index number, with the first element starting at zero. An array…
PHP Tutorial – for loop
The for loop The for loop is used to execute a set of statements for a certain number of times. Syntax: for (init; condition; increment/decrement) { code to be executed; } Components of for loop: init: set a counter variable…
PHP Tutorial – do while loop
The do while loop In do while loop the statements or conditions are executed first then that condition is evaluated, the loop will continue while the condition is true. Syntax: do { code to be executed; } while (condition); Example:…
PHP Tutorial – The while loop
A loop is a block of code that enables you to repeat the same set of statements or commands over and over again; the actual number of repetitions may be dependent on a number you specify. The while loop The…
PHP if…else…if statement
PHP if…else…if statement if…elseif….else statement – use this statement to select one of several blocks of code to be executed. The if…elseif….else statement This statement is used to select one of several blocks of code to be executed. The if..else…