Classes and funtions
From: AJ (nospam_at_redcatmedia.net)
Date: 07/26/04
- Next message: AJ: "Re: something like cron on Windows?"
- Previous message: Doug: "something like cron on Windows?"
- Next in thread: Doug: "Re: Classes and funtions"
- Reply: Doug: "Re: Classes and funtions"
- Reply: Fabrizio Giammatteo: "Re: Classes and funtions"
- Reply: CJ Llewellyn: "Re: Classes and funtions"
- Reply: rush: "Re: Classes and funtions"
- Reply: Ben Cottrell: "Re: Classes and funtions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 26 Jul 2004 12:32:35 +0000 (UTC)
Hi All
I'm pretty new to PHP. I've done some relatively complicated bits now:
written my own little shopping cart, written a content management system
with file uploads, built in newsletters, etc, etc.
The problem is, my code is probably not very elegant. For example, in my
CMS I have a page for adding pages and a page for editing pages. Much of
the code is repeated in the two pages.
So, what I'm having difficulty with is what's the difference bewteen a class
and a function? A function to me looks like a piece of code in an external
file (possibly) that I can call when I need it instead of duplicating code
in different files. A class looks to achieve the same thing. Am I missing
the point somewhere?
Cheers
Andy
- Next message: AJ: "Re: something like cron on Windows?"
- Previous message: Doug: "something like cron on Windows?"
- Next in thread: Doug: "Re: Classes and funtions"
- Reply: Doug: "Re: Classes and funtions"
- Reply: Fabrizio Giammatteo: "Re: Classes and funtions"
- Reply: CJ Llewellyn: "Re: Classes and funtions"
- Reply: rush: "Re: Classes and funtions"
- Reply: Ben Cottrell: "Re: Classes and funtions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|