All pastes #945687 Raw Edit

Stuff

public text v1 · immutable
·published 2008-03-17 03:06 UTC
rendered paste body
	/**
	 *	Writes BadRec file to disk.
	 *
	 *	@since 1.0
	 *	@access Public
	 *	@param String File handle
	 *	@param Mixed Array or String of data to be written
	 *	@author Timothy G Majerus <tmajerus@srgtampa.com>
	 *	@filesource
	 *	@return Boolean True or false
	 */
	function writeFile($filename, $content, $mode) {
		$fh = fopen($filename, $mode);
		$string = "";
		if(is_array($content)){
			$cnt = count($content);
			for($x=0; $x<$cnt; $x++) {
				$string .= $content[$x];
			}
			$results = @fwrite($fh,$string);
		}else{
			$results = fwrite($fh,$content);
		}

		return $results;
	}