diff msitegen.inc.php @ 803:ddb30c989b47

Add new helper function stSubStrCmp() for comparing substrings.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 23 Nov 2014 04:23:58 +0200
parents ff6e6c6200a4
children 2a23243a6cc4
line wrap: on
line diff
--- a/msitegen.inc.php	Sat Nov 22 23:29:23 2014 +0200
+++ b/msitegen.inc.php	Sun Nov 23 04:23:58 2014 +0200
@@ -784,6 +784,15 @@
 }
 
 
+function stSubStrCmp($str, $cmp, $send = FALSE)
+{
+  if ($send)
+    return substr($str, -strlen($cmp)) == $cmp;
+  else
+    return substr($str, 0, strlen($cmp)) == $cmp;
+}
+
+
 function stStrChop($str, $len)
 {
   return (mb_strlen($str) > $len) ? mb_substr($str, 0, $len - 3)."..." : $str;