Actually... I just thought of a potentially easy way to determine where the function came from.
At the end of the script that uses check_input(), add something like this:
function check_input() { return; }
That should cause an error message similar to:
Fatal error: Cannot redeclare check_input() (previously declared in /path/to/some/script.php:123
) in /path/to/script/you/edited.php on line 321
which tells you exactly where check_input() was originally defined.