Basically, the require and the include commands in PHP do the same thing. Both of them allows our code to use code written in another file by including it into the file we code as if it was part of it. The only difference takes place when encountering a problem. When using require the problem will crash the script and we will get a server error message. When using include the problem won’t stop running those parts of our script that can still run even though the problem that happens.┬áThe following video clip uses a short code sample for explaining this difference.

The Difference Between include and require in PHP PRO

Leave a Reply

Your email address will not be published. Required fields are marked *