From: Ævar Arnfjörð Bjarmason Date: Sat, 22 Oct 2005 21:19:50 +0000 (+0000) Subject: * in_string() function, for us strpos haters X-Git-Tag: 1.6.0~1358 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=1c4b2ec58072f810394049a8e1e2dc5894509c59;p=lhc%2Fweb%2Fwiklou.git * in_string() function, for us strpos haters --- 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; +} ?>