Orario di accesso alla pagina  17:37 - 25:11:2009
Often it is important to store data in a file when you build a script. Here we are going to see how to store data in a file.
>>details
Random characters

We are going to build a function that returns a character between some that we set initially. The comments to the function are blue-colored:

// Start of function

function gencod()
{

// Wa set a list of 35 characters and we put it in a string named $characters
$characters="1234567890abcdefghijklmnopqrstuvwxyz";

// The function rand takes a character between those defined before and assign it to $chargen
$chargen=$characters{rand(0,35)};

// The function return the character
return $chargen;
}

// End of function

Article written by the webmaster of Tuttophp