- stripos: documentation ( source)
<?php
function safeEval($arg,$badwords)
{
if(stripos($arg,$badwords) !== true)
{
echo "it has been found";
return;
}
else
return eval($arg);
}
$string = "echo 'Hello Kyle';";
$find = "Kyle";
safeEval($string,$find);