Is it possible to run a function on an error message? Specifically, the error message the PHP parser will return is:
Fatal error: Call to undefined function: nosuchfunction() in /../../this_script.php on line 2.
When I receive this error I would like to run a function get_include_file(), here's my thinking:
- I have a specific folder location for my function library.
- I have a specific area at the top of scripts where I put my include files.
- If this works I know the name of $PHP_SELF
- This function goes into the page source of the script it's called in and adds the line
include('file_containing_missing_function.php');
Can this be done?
Sam Fullman
Compass Point Media