3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function in_string($needle, $haystack, $insensitive = false) { if ($insensitive) { return false !== stristr($haystack, $needle); } else { return false !== strpos($haystack, $needle); } } $needle = 'as'; $haystack = 'This is my assessment.'; var_dump(in_string($needle, $haystack, true)); var_dump(in_string(strtoupper($needle), $haystack, true)); var_dump(in_string($needle, $haystack, false));
Output for 4.3.0 - 7.1.0
bool(true) bool(true) bool(true)