php3-list | 199903
Date: 03/18/99
- Next message: Jean-Marc Libs: "Re: [PHP3] Cookies lifetime"
- Previous message: Juan A. Pons: "Re: [PHP3] [OT] Web -> CD -> Search Engine"
- In reply to: Mark Derricutt: "[PHP3] Objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Mark Derricutt Wrote:
> Hi, could someone post some example code on creating objects with PHP?
> I'd tried a simple function using object_init and add_property_string
> and stuff but it didn't want to work :(
<?PHP
class demonstration {
var $msg = "";
function demonstration($MSG) {
echo "Demo class initialised<BR>\n";
$this->msg = $MSG;
}
function proveIt($param) {
echo "hey I'm here and when you initialised me you sent me".
" this message: \"$this->msg\"<BR>\n";
echo "plus you called this function with the parameter:".
" \"$param\"<BR>\n";
}
}
$demo = new demonstration("Hi There");
$demo->proveIT("Wow it worked");
?>
Never used object_init and add_property_string so can't help u with those
functions tho
Andrew
-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev-list-admin <email protected>
- Next message: Jean-Marc Libs: "Re: [PHP3] Cookies lifetime"
- Previous message: Juan A. Pons: "Re: [PHP3] [OT] Web -> CD -> Search Engine"
- In reply to: Mark Derricutt: "[PHP3] Objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

