<?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($needle, $haystack, false));
- Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.22
- Parse error: syntax error, unexpected ';' in /in/nINu1 on line 13
Process exited with code 255.
preferences:
179.86 ms | 1395 KiB | 58 Q