I'm creating a small classroom-app website, where students will be logging in with a random generated code which the teacher will give them. I need every student to have a unique code so I'm using the following script
$count = file_get_contents($classcode . "/count.txt");
$count = $count + 1;
file_put_contents($classcode . "/count.txt", $count);
Now my question is, will clients be able to receive the same value for $count
if they load up the page simultaneously? And maybe anyone has an better way to do such thing?