* in_string() function, for us strpos haters
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 5278bba..50f6302 100644 (file)
@@ -1477,4 +1477,15 @@ function wfAppendToArrayIfNotDefault( $key, $value, $default, &$changed ) {
 function wfEmptyMsg( $msg, $wfMsgOut ) {
        return $wfMsgOut === "<$msg>";
 }
+
+/**
+ * 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;
+}
 ?>