Hi,
write $this->items[$id] instead of $this->$items[$id]
bye
Wieger
Stefan Kostopoulos wrote:
>
> Hi!
>
> Can anybody explain to me why this script outputs:
>
> oneone
>
> instead of:
>
> zeroone
>
> ???
>
> Thanks,
>
> stefan
>
> class Cart {
> var $items; // Items in o
Hi!
Can anybody explain to me why this script outputs:
oneone
instead of:
zeroone
???
Thanks,
stefan
$items[$id] = $text;
}
function output($id){
echo $this->$items[$id];
}
}
$c = new Cart;
$c->add_item(0,"zero");
$c->add_ite
2 matches
Mail list logo