From 1c4b2ec58072f810394049a8e1e2dc5894509c59 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 22 Oct 2005 21:19:50 +0000 Subject: [PATCH] * in_string() function, for us strpos haters --- includes/GlobalFunctions.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 5278bba7f1..50f6302ff0 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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; +} ?> -- 2.20.1