From d80a4e487b446129b936a67548a119fcbe894f66 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 27 Aug 2012 18:56:12 +0200 Subject: [PATCH] Add redirect and ceil_precision functions --- include.misc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include.misc.php b/include.misc.php index 89ec47b..8ee7516 100644 --- a/include.misc.php +++ b/include.misc.php @@ -311,3 +311,15 @@ function ends_with($haystack, $needle) return (substr($haystack, -strlen($needle)) == $needle); } +function redirect($target) +{ + header("Location: {$target}"); + die(); +} + +function ceil_precision($value, $precision = 0) +{ + $multiplier = pow(10, $precision); + + return ceil($value * $multiplier) / $multiplier; +}