If you want to debug variable content in php there are several ways to do it
You could use
var_dump ()
To fully show the content of the variable (object, class or whatever this variable is).
If you want to debug for errors you can active the error display config on .htaccess, .user.ini or using php comands to active the error display options.
E.g. If you are using a local PHP server, in most cases the error display options are active for default.
So If you just want to debug a variable conten, like $_POST, you can use
var_dump($_POST);
You cant prevent error using isset() for variables that you dont know if have any value.
if ( isset($_POST) ) var_dump($variable_name);
you can try this code
URL: http://localhost/vardump.php?test=this%20is%20a%20variable%20content%20test&value=123
echo 'This is a $_POST debug';
var_dump( $_POST );
echo 'This is a $_GET debug';
var_dump( $_GET );
echo 'This is a non setted variable';
var_dump( $variable_name );
result
This is a $_POST debug
D:\wamp64\www\vardump.php:4:
array (size=0)
empty
This is a $_GET debug
D:\wamp64\www\vardump.php:7:
array (size=2)
'test' => string 'this is a variable content test' (length=31)
'value' => string '123' (length=3)
This is a non setted variable
( ! ) Notice: Undefined variable: variable_name in D:\wamp64\www\vardump.php on line 10
Call Stack
# Time Memory Function Location
1 0.0002 407224 {main}( ) ...\vardump.php:0
D:\wamp64\www\vardump.php:10:null
This is an example
var_dump($your_var)inphpfor oberserving variables values