Re: What is $this->
| From: | Leonard Burton | Date: | Mon, 19 Feb 2007 03:19:01 +0000 |
| Subject: | Re: What is $this-> | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-249004@lists.php.net to get a copy of this message | ||
HI,
$this->SetFont('Arial','B',15);what you include is a snippet from a class. Here is a brief into to how a class works, sort of like a function. The $this refers to the class from inside of the class. <?php class write{ var $message; function set($message){
$this->$message = $message;} function display(){
print "$this->message\n";} }// class write //actually use the class $class = new write(); $class->set("This is a test message"); $class->display(); ?> I hope this helps. Leonard -- Leonard Burton, N9URK http://www.jiffyslides.com service@jiffyslides.com leonardburton@gmail.com "The prolonged evacuation would have dramatically affected the survivability of the occupants."