Classes and Functions + Include/Require
Moderator: General Moderators
Classes and Functions + Include/Require
Hello, I was wondering about php classes and functions. I was wondering how I would program classes with functions, and how I would go about calling multiple functions from the same class? Also, when I want to include a page that only has php on it do I not close the php script with the ?>?, And also how would I include files that are in a directory stored in relation to a folder, thanks
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Classes and Functions + Include/Require
http://www.php.net/manual/en/language.oop5.basic.phpWolf95 wrote:Hello, I was wondering about php classes and functions. I was wondering how I would program classes with functions, and how I would go about calling multiple functions from the same class?
You can, but you don't need to.Wolf95 wrote:Also, when I want to include a page that only has php on it do I not close the php script with the ?>?,
To include a file above the current directory use '..' such as '../../file.php' includes a file two directory levels up from the current directory. For below the current directory just do 'dir1/dir2/file.php'. In general, it is better to user absolute paths if you can.Wolf95 wrote:And also how would I include files that are in a directory stored in relation to a folder, thanks
(#10850)