& lt? Server-side programming language (abbreviation of professional hypertext preprocessor)
//data source
$file_name? =? record . txt ';
//Initialize the data source
What if? (! File exists ($ file name)? {
//Generate a number of 1- 10.
$data? =? array();
for($ I = 1; $ i & lt= 10; $i++){
$data[]? =? $ I;
}
//Save the data
$data? =? Implosion (',',? $ data);
File content ($ file name, $data,? LOCK _ EX);
}
//Read the data source
$ record? =? File acquisition content ($ file name);
if($record){
$ record? =? Decomposition (',',? $ record);
//Random sampling
$rand_arr? =? array _ rand($ record);
Echo? Congratulations on winning. $record[$rand_arr]。 "signature. ;
//Delete this sign and put it back in the warehouse.
unset($ record[$ rand _ arr]);
$data? =? Implosion (',',? $ record);
File content ($ file name, $data,? LOCK _ EX); //LOCK_EX prevents concurrent operations.
} Otherwise {
Echo? The lottery is over, thank you for your participation! ;
}