hello!

Iam wondering how can I include file in class? is it possible?
is it possible to create object inside another object?

regarding include it works if I do like this

class myClass{
        function(){
                   include 'func.php'; 
                   func(); //returns $var 
              //do something with $var
              return $array;
                      }

    function1(){
               include 'func.php'; 
               func();//returns $var 
          //do something with $var
          return $array2;
                  }
}

but it doesn't make eny sence to include it over and over again in every function so I would like to that get some thing like

 class myClass{
        include 'func.php'; //but this don't work
        func(); // $var=3

    function(){
          //do something with $var
          return $array;
                  }

    function(){
          //do something with $var
          return $array2;
                  }
 

any ideas or comments?

thanx in advance

    why dont you go for inheritance of clasess, i think that could solve your problem.

      Write a Reply...