PHP Tutorial – For Loops
The “for loop” execute a block of code a specified number of times while a specified condition is true.
Syntax
for (init; condition; increment)
{
code to be executed;
}
Posted in PHP Tutorials | 0 Comments
The “for loop” execute a block of code a specified number of times while a specified condition is true.
for (init; condition; increment)
{
code to be executed;
}
Posted in PHP Tutorials | 0 Comments
The do…while statement will always execute the block of code once. After this first execute it will check the condition, and repeat the loop (keep executing) while the condition is true. More »
Posted in PHP Tutorials | 0 Comments
The PHP language has four different kinds of conditioned loops. In this PHP tutorial we will look at the “while” loop. Loops are used to execute a block of code multiple times.
In PHP, we have the following loop statements: More »
Posted in PHP Tutorials | 0 Comments
In this PHP language tutorial we will take a look at arrays in PHP. A normal variable holds only one value. An array is different. An array lets you declare and work with a collection of values.
If you would use normal variables to store for instance a list of names it would look something like this: More »
Posted in PHP Tutorials | 0 Comments
In this PHP programming tutorial we will take a look at the “if else statement” (the PHP “switch statement“ can be found here.) Conditional statements (such as “if else” or “switch”) are used to alter the flow of a program if a specific test condition is true. More »
Posted in PHP Tutorials | 0 Comments
Just as the PHP language “if…else” statement, you can use the “switch” statement to alter the flow of a program. In other words; conditional statements are used to perform actions on different conditions. The switch statement is used to select one of many blocks of code to be executed. More »
Posted in PHP Tutorials | 0 Comments
In this PHP programming tutorial we will look at PHP operators. An operator is something that can be used to do operations on values to get a new value. We will look at: Arithmetic, Assignment, Logical, Comparison and Concatenation (string) Operators. More »
Posted in PHP Tutorials | 0 Comments
In this PHP programming tutorial we will look at common string functions. String variables are used to store and manipulate text.
In the PHP script below we assign the text “Hello everybody” to a string variable $my_string and print the content of the variable: More »
Posted in PHP Tutorials | 1 Comment
In this PHP programming language tutorial we will look at variables. A variable is used to store information or values in, like text-strings, numbers or arrays. As long as you don’t remove the value in a variable then you can use the variable (thus the value) over and over again. More »
Posted in PHP Tutorials | 0 Comments
As we explained in the PHP introduction tutorial the PHP code is executed on the server-side. The result of a PHP program is send in plain HTML to the browser. More »
Posted in PHP Tutorials | 1 Comment