Classes and funtions

From: AJ (nospam_at_redcatmedia.net)
Date: 07/26/04


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



Relevant Pages

  • Re: html wrapper
    ... All good advice, thanks. ... built in feature of a content management system. ...
    (alt.html)
  • Re: Shop cart
    ... Have you checked: PayPal Shopping Cart ... > add-on or update with a built in shopping cart for we who use FrontPage to ... > Does anyone know of a good hsop cart to use with FrontPage - we are looking ...
    (microsoft.public.frontpage.client)
  • Using Front Page to sell a product with a shopping cart.
    ... I built my site using Frontpage and now I want to sell a product. ... How do I use FrontPage to add a shopping cart? ...
    (microsoft.public.frontpage.client)