summaryrefslogtreecommitdiff
path: root/app/helpers.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers.php')
-rw-r--r--app/helpers.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/helpers.php b/app/helpers.php
index 9246362..5c65c57 100644
--- a/app/helpers.php
+++ b/app/helpers.php
@@ -83,3 +83,22 @@ function getCurrentSeason(){
case 12: return "Fall";
}
}
+
+function escapeLike($string){
+ $search = array('%', '_');
+ $replace = array('\%', '\_');
+ $string = str_replace($search, $replace, $string);
+ $string = explode(" ", $string);
+ return implode("%", $string);
+}
+
+
+function compare($str1, $str2) {
+ $str1 = preg_replace("/[^a-z0-9]/", '', strtolower($str1));
+ $str2 = preg_replace("/[^a-z0-9]/", '', strtolower($str2));
+
+ if ( $str1 != $str2 ) {
+ return false;
+ }
+ return true;
+}