Skip to content

Instantly share code, notes, and snippets.

@billhance
Forked from nikita2206/gist:3035134
Created July 3, 2012 01:16
Show Gist options
  • Save billhance/3036863 to your computer and use it in GitHub Desktop.
Save billhance/3036863 to your computer and use it in GitHub Desktop.
If String Contains
<?php
if(!function_exists('if_string_contains'))
{
function if_string_contains($needle,$haystack) {
if (is_array($needle)) {
foreach ($needle as $n) {
if (strpos($haystack, $n) !== false) {
return true;
}
}
} else {
return strpos($haystack, $needle) !== false;
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment