I want to include file in PHP class.
Why I want to include file ?
there are too many functions in my class, and its very hard to find them. So I want to put functions in a file by their type, and include them by calling the file in class.
like: all function for head will be inside a head.php file.
So please tell me how do I include files in class ?
What if you extend the class and put functions in it?
class Second extends Main
{
}
Why would you not create a helper class and just include in globally? So you can just call it statically? For example in my application I have a date helper class and whenever I need date function I just use date::currentDay for example. Including is kind of an old concept though. You should really be using autoloading so you include everything up front.