Tags
PHP , Debug
Asked 2 years ago
13 Jul 2021
Views 362
Gwen

Gwen posted

How do I debug PHP ?

How do I debug PHP ?
jessica

jessica
answered Jul 18 '21 00:00

there are many way of debugging in php
first of all get all errors or warnings in the screen or specific error logs file

set error reporting set true in debug mode

error_reporting(1);

error_reporting(E_ALL) show all notices , warnings , and fatal errors

error_reporting(E_ALL);



to debug php array , use print_r

$a=array("a","b");
print_r($a);

print_r will print array with values

to debug variable with type , use var_dump

var_dump($a)

var_dump will print value and type
Post Answer