Thread: OOP with PHP
View Single Post
Old 07-31-2002, 06:23 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
OOP with PHP

as some of you know, i'm working on a new bbs. last night i ported the functions i have into a class .. i'm really enjoying object oriented programming with php.

here's an example:
PHP Code:
<?
class user
{     
     
set_name($username)     
     {         
           
$this->username=$username;     
     }
}

$me = new user();
$you = new user();

$me->set_name("mike");
$you->set_name("joe schmoe");

echo 
"my name is " $me->username;
echo 
"your name is " $you->username;

?>
cool stuff!
sde is offline   Reply With Quote