Location: PHPKode > projects > gframe > gframe/functions.php
<?PHP

// Nasty Function !
// It is not that easy, because array_search looks up the pattern in every element.
// In case I just want to search in the first element of every entry.
// Doing a little work around

function find_in_array($array, $pattern)
{
	foreach($array as $array_split)
	 if($pattern == current($array_split))
	 	$array_result[] = $array_split;
	return $array_result;
}

function create_info_page($message, $template_path)
{
		$smarty = new Smarty;
		$smarty->assign('message', $message);
		$smarty->display("$template_path/message.tpl");
		die();	
}

?>
Return current item: gframe