Q: PHP - Capture all error_get_last() in One String Is it possible to capture/gather all the errors on page and concatenate them to a string by using:
$allErrors = ""; 
$allErrors .= error_get_last(); // Each time an error shows up

I like to log errors in my database and would prefer to log all these PHP errors since I already have SQL-related PHP Fatal Errors logged.

A: error_get_last(), like the name is suggesting, only gives you the last error. And the fact that most errors will stop your script from running will get you only the last one and none of the previous ones. But you can set an own handler to catch every thrown error and exception. Here is an example
//function for exception handling
function handle_exception (Exception $exception) {

    //here you can save the exception to your database

}

//function for error handling
function handle_error ($number, $message, $file, $line, $context = null) {

    //pass/throw error to handle_exception
    throw new ErrorException ($message, 0, $number, $file, $line);

}

//set error-handler but only for E_USER_ERROR and E_RECOVERABLE_ERROR
set_error_handler ('handle_error', E_USER_ERROR|E_RECOVERABLE_ERROR);

//exception-handler
set_exception_handler ('handle_exception');

