PHP issues using flock - file locking
问题 I'm having a problem using the PHP flock() function. I need to write two different variables ( $O and $o ) but often it doesn't write the second variable ( $o ), maybe because the file is written two times in a row. Here's the code: include_once "changevar.php"; changevar("O",$seguimedia,$filename,0); changevar("o",$offerta,$filename,0); $seguimedia , $filename and $offerta are correctly set. changevar.php: function changevar($varname,$newval,$filename,$type) { while(!$fp=fopen($filename,"c+"