Author: Coding_Robort

Lesson 14 – PHP for loop Example

PHP for loop Similar to the while loop, the for loop can be used to execute statements as long as a particular condition is met. The syntax of the for loop is as follows: <?Php for(start value, condition, looping) {  //  instructions } ?> An example would be: <?php for($i=0; $i < 10; $i++) { echo "$i, "; } ?> [...]

Read More

PHP Lesson 12 – Common exercises

php exercises solution Here are three small exercises to deepen what you've just learned. First, we build a small password-protected page. Here's an example of how to check if form fields have been filled out by the user. Finally, it seems like several websites with only one PHP file can spend. Exercise 1: PHP Password protection For our [...]

Read More

PHP Lesson 11: Logical operators AND, OR, !, &&, || ()

php logical operators Often it is not enough to check only one condition in an if statement. For example, if you do a password query, you want to know if the username and password are correct. For this purpose, there are the logical operators. By means of any number of conditions can be checked. To check several conditions, the following keywords exist :   Both conditions [...]

Read More