Possible Duplicate:
What is .inc and why to use it?
I am working on a project which is partially developed by someone else. He has defined some inc files and some funcitons inside the files. Now i need to use those functions. For that, i need to know the below details. I tried some links by googling it. But i still can’t get clear idea. My doubts are,
1) what is .inc file?
2) Is there any difference between .inc file and .php file?
3) How to include an inc file inside a php file?
4) How to access the functions defined in .inc file inside php file?
Anyone help me by providing the details.
An inc file is just a file that contains some stuff (functions, classes, constants) that you want to be able to include in other files.
There is no difference between an inc file and a php file, except that unless specifically configured to do so, your server won’t execute the php in an inc file unless it is included in a php file.
You can include the file like this:
include “directory/file.inc”;
Once you’ve included the file, you can consider its content to be part of the file you are in, so you can access the contents as you would if they were in your file.
Note: There is no special meaning to the .inc extension – you could call it a .bunnyrabbit file, and it would work exactly the same.