<?php
class ShopProduct {
public $title;
public $content;
function __construct($title,$content) {
$this->title = $title;
$this->title = $content; }
function getProducer()
{ return $this->title;
}
function getContent()
{ return $this->content;
}
function foo() { echo "hello!";return 1; }
// end class shop product
}
$product1 = new ShopProduct('Product 1','somegirls');
$product2 = new ShopProduct('Product 2','someguys');
print "this is {$product1->foo()}<br/>";
print "this is {$product1->getProducer()}<br/>";
print "this is {$product2->getContent()}<br/>";
?>
the result is .
hello!this is 1
this is somegirls ( the content show ? why not the title ? )
this is ( the content dont show here . )
please help me on this two question . thanks .
Adam Ramadhan