From 956933fe9b4da463c7904a67f642721d86651d2b Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Mon, 16 Jul 2012 00:35:32 +0200 Subject: [PATCH] Add ends_with function --- include.misc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include.misc.php b/include.misc.php index 9f91308..89ec47b 100644 --- a/include.misc.php +++ b/include.misc.php @@ -306,3 +306,8 @@ function generate_pagination($min, $max, $current, $around, $start, $end) } } +function ends_with($haystack, $needle) +{ + return (substr($haystack, -strlen($needle)) == $needle); +} +