diff --git a/helpers.inc.php b/helpers.inc.php index f9394de..d0034f0 100644 --- a/helpers.inc.php +++ b/helpers.inc.php @@ -1163,3 +1163,11 @@ function arg_exists($args, $needle) return in_array($needle, $args, $strict); } +if(!function_exists('str_ends_with')) +{ + function str_ends_with($haystack, $needle) + { + // search forward starting from end minus needle length characters + return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false); + } +}