private function FilePutContents($file, $str) {
    $fileObj = new SplFileObject($file, 'w');
    while (!$fileObj->flock(LOCK_EX)) {
      usleep(1);
    }
    $bytes = $fileObj->fwrite($str);
    $fileObj->flock(LOCK_UN);
    return $bytes;
  }
private function FilePutContents($file, $str) {
    $fileObj = new SplFileObject($file, 'w');
    while (!$fileObj->flock(LOCK_EX)) {
      usleep(1);
    }
    $bytes = $fileObj->fwrite($str);
    $fileObj->flock(LOCK_UN);
    return $bytes;
  }
private function FilePutContents ( $ file , $ str ) { $ fileObj = new SplFileObject ( $ file , 'w' ) ; while ( ! $ fileObj -> flock ( LOCK_EX ) ) { usleep ( 1 ) ; } $ bytes = $ fileObj -> fwrite ( $ str ) ; $ fileObj -> flock ( LOCK_UN ) ; return $ bytes ; }
Saves string inside a file
@param  string  $file
@param  string  $str
@return boolean
Saves string inside a file