I want to make my own error generator when I program (HTML + PHP). How can I take a string when I have an error and insert a variable?
Example:
echo "Error # 03: variable undefined string # ". $ line. " ";
Thank.
the variables you are looking for:
__LINE__ __FILE__ __FUNCTION__ __CLASS__
there is a predefined constant, __LINE__which contains the string in which it was actually called.
__LINE__
, , trigger_error() " ", . , , PHP, - - ,
trigger_error()
debug_backtrace().
debug_backtrace()
, PHP , . ( , script ), , .
If PHP does not display error messages, use the following code to display all PHP error messages and warnings on the page:
error_reporting(E_ALL);
Source: https://habr.com/ru/post/1795611/More articles:Toggle background view - androidksoap2 error sending complex object - javaWhat Java XML Parser is for easy processing? - javaProblem transferring data from Javascript to Flex - javascriptFast SQL query for months - sqlGet PHP to display only warnings and errors - phpForm.Owner is installed from a separate thread in .NET 3.5 - multithreadingQuestion from the interview: Are you familiar with Linux? - linuxHow to get the root of a tree without parsing the whole file? - pythonC # Linq question GROUP BY? - c #All Articles