Reply to include file in class

Your name:

Reply:


Posted by Carramba on 01/04/06 01:38

hello!

Iam wondering how can I include file in class? is it possible?
is it possible to create object inside another object? for instance if I
create mysqli connection object inside another class is that doible? or
one should pass created objekt as parameter to another objekt?

regarding include it works if I do like this


PHP Code:
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


PHP Code:
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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация