Error Finding

On a few occasions now I’ve made mistakes and I’m really struggling to find where I’ve gone wrong. I’ve tried using checkers online but I don’t really understand them if I’m honest.
Is there a “beginners” way to finding errors?

Thanks.

In your dev environment you should show all errors

You can set these options in php.ini or add this code to the beginning of your script(s):
[php]error_reporting(E_ALL);
ini_set(‘display_errors’, 1);[/php]

This will give you proper errors, warnings and notices.

[hr]

And you should use a proper IDE, like PHPStorm, Netbeans, etc. This will help you find smaller logical errors, like

[php]if ($foo = ‘bar’) {
// should only execute if $foo equals ‘bar’, but executes every time
}[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service