H
H
hesy2020-09-03 20:26:53
PHP
hesy, 2020-09-03 20:26:53

How to show Notice and Warnings and not stop the application?

Now if you access an array key that does not exist, a beautiful page immediately appears with an error that the key does not exist:

ErrorException
Undefined index: MyMissKey


How to turn it off so that it is displayed at the top of the page as usual and the application works to the end?
Not completely disable, just allow these errors without calling exception.

In AppServiceProviderthe method, bootI can only hide the warnings altogether error_reporting(E_ALL ^ E_NOTICE);, but that's not it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2020-09-04
@hesy

https://www.php.net/manual/en/function.isset
https://www.php.net/manual/en/function.array-key-exists

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question