All pastes #420283 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-02 01:10 UTC
rendered paste body
		public function Template($path, $keywords_array)
		{
			if (is_file($path))
			{
				$template = file_get_contents($path);
				
				if (is_array($keywords_array))
				{
					while (list($key, $val) = each($keywords_array))
					{
						$replace = '{'.$key.'}';
						$template = str_replace($replace, $val, $template);
					}
				}
				
				return $template;
			}