<?php

$log_file = "debug.log";

function write_to_log($log_string) {
	global $log_file;
	
	if(!$file_handler = fopen($log_file, 'a')) {
		//Print "Could not open file";
		return false;
	}
	
	$complete_string = date("Y-m-d H:i:s", time())." :: ".$log_string."\n";
	
	if(fwrite($file_handler, $complete_string)) {
		$returndata = true;
	} else {
		$returndata = false;
	}
	
	fclose($file_handler);
	
	return $returndata;
}


?>