Tag Archive | "loops"

Generate Random Passwords

Thursday, January 21, 2010

2 Comments

For generating passwords multiple methods can be used. In this tutorial we’ll be discussing 2 ways to generate random passwords. The result of both methods is exactly the same. Although method 1 is based on generating random indexes and picking another (random) index’s value each time when adding a new random character to the random [...]

Continue reading...

Foreach Loop

Saturday, January 16, 2010

0 Comments

Note: This chapter requires you to have a basic knowledge of arrays. If you don’t know what arrays are or how they work, please first have a look at the arrays tutorial. The foreach loop is used to get all keys and values from all indexes (’sub-variables’) of an array and handle them with your given [...]

Continue reading...

For Loop

Saturday, January 16, 2010

0 Comments

Then we’ve got the for loop. This loop is in some point of view kind of smilar to the while loop as it as well repeats a certain code several times. Though, the for loop requires a variable to be set, an increment value (or decrement) and a condition, as argruments of the loop. A [...]

Continue reading...

While Loop

Friday, January 15, 2010

0 Comments

This loop can be used to repeat a code several times untill the condition of the loop is not true anymore. The strucuture of a while loop looks like this: while( ... condition ... ) ... act code ... } So, while the condition between brackets is still true, it will keep repeating the ‘act [...]

Continue reading...

Basic IF Loop

Friday, January 15, 2010

0 Comments

Note: everything put between … and … is NOT an actual code but are just ‘comments’ that indicate what should be put in there. Loops are very useful and used a lot in PHP. They’re used to check conditions and act based on whether the condition checked was true or false. A basic loop to do [...]

Continue reading...

PHVsPjwvdWw+