RE: [PHP] Question on class syntax
| From: | Luis Lebron | Date: | Thu, 07 Aug 2003 18:32:47 +0000 |
| Subject: | RE: [PHP] Question on class syntax | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-158713@lists.php.net to get a copy of this message | ||
Thanks for the information. I checked the manual but wasn't able to find it.
Luis
-----Original Message-----
From: CPT John W. Holmes [mailto:holmes072000@charter.net]
Sent: Thursday, August 07, 2003 1:35 PM
To: Luis Lebron; Php-General (E-mail)
Subject: Re: [PHP] Question on class syntax
From: "Luis Lebron" <llebron@sigmatech.com>
> I am currently using a php class that uses the following syntax:
>
> $value= htmlcleaner::cleanup($value);
>
>
> What exactly is the :: used for? Is there a different syntax for :: ?
You're calling the cleanup() method of the "htmlcleaner" class.
You could also have:
$ob = new htmlcleaner;
$value = $ob->cleanup($value);
You can use the first method without having to actually make a new object.
Whether that's better or not depends upon your application. It basically
turns your "object" into a function repository.
---John Holmes...