Re: PHP Manual, Chapter 13. Classes and Objects
by "Rossi Designs" <webmaster(at)rossidesigns.net>
|
Date: |
Wed, 29 Mar 2000 16:26:35 -0500 |
To: |
"Franklin, Douglass" <Douglass.Franklin(at)ssa.gov>, "'HTML Writer's Guild'" <hwg-languages(at)hwg.org> |
References: |
ssa |
|
todo: View
Thread,
Original
|
|
the -> operator is the way to access methods of a class,
just like image.src would be in javascript
----- Original Message -----
From: Franklin, Douglass <Douglass.Franklin(at)ssa.gov>
To: 'HTML Writer's Guild' <hwg-languages(at)hwg.org>
Sent: Wednesday, March 29, 2000 2:28 PM
Subject: PHP Manual, Chapter 13. Classes and Objects
| In the example on the first page of chapter 13, there's this expression:
|
| <?php
| class Cart {
| var $items; // Items in our shopping cart
| // Add $num articles of $artnr to the cart
| function add_item ($artnr, $num) {
| $this->items[$artnr] += $num;
| }
| // Take $num articles of $artnr out of the cart
| function remove_item ($artnr, $num) {
| if ($this->items[$artnr] > $num) {
| $this->items[$artnr] -= $num;
| return true;
| } else { return false; }}}
| ?>
| what is the "->" operator in this context?
| Doug Franklin
| Social Security Administration
| Office of International Operations
| Module 1
| Benefit Authorizer
| Site LAN Coordinator
| Site Training Coordinator
| (410) 966-3735
|
|
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA