I have the following function to write to a log file:
function writelog($type, $text){
global $root;
$userid=$_SESSION['userid'];
$tdate=date('d/m/Y H:i:s');
$file = $root.'/logs/log.txt';
$input=$userid."^".$type."^".$tdate."^".$text."*";
file_put_contents($file, $input, FILE_APPEND);
}
This function is used to add entries to a log whenever an admin of my database does a certain activity.
What would happen if two admins perform an action at exactly the same time which writes to the log file? Is it possible that the strings appended to the file would then be jumbled or merged together or would it always be inserted sequentially?