I want a way to write the errors and warnings in PHP
script or the output of the script for example echo "Hello World"; in Text File
I don't think error_log()
function is useful in my case because this function is logging the errors that I previously mentioned in my code.
What I want is something like this
PHP Code
<?php
echo "Your Name is ".$name; // $name here is not defined
?>
This script will give the following error
Notice: Undefined variable: name in C:\wamp64\www\example.php on line 3
This error will be written in php_error.log automatically in my server, but I want to write this error in separated text file.