Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP class in another PHP file

Status
Not open for further replies.

adrumsolo4u

Programmer
Jan 29, 2007
14
US
after coding quite a bit into one file i have finally decided it would be much easier to edit if i had different classes in multiple files. i know you can do this is C++ because i've coded in that before.
anyone know any tutorials which could show me the way?

PHP + CSS... Viva Revolution
<a href="
 
I'm not sure exactly what you're asking.

You can have a class defined in a file separate from the file of the main script. All the main script needs to do is:

include ('<filename of class-defining file>');

or

require ('<filename of class-defining file>');

See

Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top