X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fcommon.lib.php;h=f483b3d4c0ca04af33f7d107e438568ec3fc28a8;hb=30634c0b3869d459552df1da06ec264fb1e6b086;hp=0e9ff9e49cfb0f6922253689d89482109583dcf3;hpb=cb611bf2abbb4072459632155b11301ae6fe840b;p=timetracker.git diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 0e9ff9e4..f483b3d4 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -391,6 +391,14 @@ function ttStartsWith($string, $startString) return (substr($string, 0, $len) === $startString); } +// ttEndsWith functions checks if a string ends with a given substring. +function ttEndsWith($string, $endString) +{ + $len = strlen($endString); + if ($len == 0) return true; + return (substr($string, -$len) === $endString); +} + // ttDateToUserFormat converts a date from database format to user format. function ttDateToUserFormat($date) {