php 下面代码是什么意思 有哪位先生看到懂 麻烦解释下
classShoProductWriter{publicfunctionwrite($shopProduct){$str="{$shopProduct->title}:"...
class ShoProductWriter
{
public function write( $shopProduct )
{
$str = "{$shopProduct->title}:"
.$shopProduct->getProducer()
."({ $shopProduct->price})\n";
print $str;
}
}
$oriduct1 = new shopProduct("My Antonia","willa","cather",5.99);
$write = new ShoProductWriter();
$write->write($oriduct1); 展开
{
public function write( $shopProduct )
{
$str = "{$shopProduct->title}:"
.$shopProduct->getProducer()
."({ $shopProduct->price})\n";
print $str;
}
}
$oriduct1 = new shopProduct("My Antonia","willa","cather",5.99);
$write = new ShoProductWriter();
$write->write($oriduct1); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询