_server/functions.incl.php
/**
	 * Set the file content
	 * @param string $data The data to store into file
	 * @return boolean True if the data where saved, false else.
	 */
Set the file content
@param string $data The data to store into file
@return boolean True if the data where saved, false else.
Set the file content @param string $data The data to store into file @return boolean True if the data where saved false else .
public function write($data){
		if($this->file === false  && $this->locked !== true){
			return false;
		}
		ftruncate($this->file, 0);
		rewind($this->file);
		if(!mb_detect_encoding($data, "UTF-8", true)){
			fwrite($this->file, utf8_encode($data));
		}else{
			fwrite($this->file, $data);
		}
		fflush($this->file);
		return true;
	}
public function write ( $ data ) { if ( $ this -> file === false && $ this -> locked !== true ) { return false ; } ftruncate ( $ this -> file , 0 ) ; rewind ( $ this -> file ) ; if ( ! mb_detect_encoding ( $ data , " UTF-8 " , true ) ) { fwrite ( $ this -> file , utf8_encode ( $ data ) ) ; } else { fwrite ( $ this -> file , $ data ) ; } fflush ( $ this -> file ) ; return true ; }
Set the file content
 @param string $data The data to store into file
 @return boolean True if the data where saved, false else.
Set the file content @param string $data The data to store into file @return boolean True if the data where saved false else .
//Clearing content and go back to first characters //Save data (in UTF8 if possible)