1
Is there a variable that shows if there is an offset error in php, but without displaying on the screen ? like a function that evaluates ? Thank you
1
Is there a variable that shows if there is an offset error in php, but without displaying on the screen ? like a function that evaluates ? Thank you
2
It would be like this, it would show in the logs and on the screen would not display:
ini_set('display_errors',0);
ini_set('display_startup_erros',0);
error_reporting(E_ALL);
if you replace 0(zero) with 1, it will show on the screen as well.
But what to check on an if ? type if($existeerro == true {} How would you do ?
The correct one is you develop showing all the errors and treat this before because you want to check if there is an error in an if?
because there is a case that I need to redirect, to a second way to be done like if error = 0 ok if error method2
So I think it would be something like @rray quoted above: if(! isset($arr['index']){} denying isset.
but it is not always that the error occurs ...
put some example of your code, so we can better understand what you want.
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
Usually you do a test with the
isset()
,if(isset($arr['index']){ ...
– rray
Currently use
&$array[$key]
. But I recommend using theisset()
– Mauro Alexandre
Isn’t there something that checks if it will print on the screen ? like a log function that I can check ?
– Augusto Furlan
What is the specific error you want to avoid? Non-existent array element? Puts more information that makes it easier to help.
– Ricardo Moraleida
Notice: Undefined offset: 8 this is the error
– Augusto Furlan