Why include when you can require in PHP?

Sometimes you are including files from libraries that you do not control or your code is being run on different environments.

It is possible that some of these aren’t actually required for your script but are helper files or extras.

For instance, if your PHP is generating HTML, you might use an include to add a banner. But you wouldn’t want your file to halt if for some reason that banner file was missing. You’d want to gracefully fail instead.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)