Say there's an if
statement:
if (stripos($names, "jack") !== false || stripos($names, "bob") !== false) {
echo "Jack or Bob found.";
}
I'd like to use this statement across multiple pages without having to edit the if statement in each page if I wanted to change the if
parameters.
I've tried this:
$contents = file_get_contents('names.php');
if ($contents) {
echo "Jack or Bob found.";
}
names.php
<?php
$return_me = stripos($names, "jack") !== false || stripos($names, "bob") !== false;
return $return_me;
?>
And it doesn't work. I'm trying to get this done without using output buffering because it screws up my entire script. Does anyone know a solution?