Problem Statement
Which function is used to trigger a user-defined error?
Explanation
trigger_error() allows you to create custom warning or notice messages in PHP code. Useful for debugging or enforcing logic.
Code Solution
SolutionRead Only
trigger_error('Invalid input', E_USER_WARNING);