* in_string() function, for us strpos haters
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 22 Oct 2005 21:19:50 +0000 (21:19 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 22 Oct 2005 21:19:50 +0000 (21:19 +0000)
includes/GlobalFunctions.php

index 5278bba..50f6302 100644 (file)
@@ -1477,4 +1477,15 @@ function wfAppendToArrayIfNotDefault( $key, $value, $default, &$changed ) {
 function wfEmptyMsg( $msg, $wfMsgOut ) {
        return $wfMsgOut === "&lt;$msg&gt;";
 }
+
+/**
+ * Find out whether or not a mixed variable exists in a string
+ *
+ * @param mixed  needle
+ * @param string haystack
+ * @return bool
+ */
+function in_string( $needle, $str ) {
+       return strpos( $str, $needle ) !== false;
+}
 ?>