所屬章節課程:用list()結構和each()配合完成數組的遍歷操作:必須掌握
$arr=['name'=>'peter','age'=>3,'ismarride'=>true]; foreach($arr as $key)
2017-08-030个赞
<?php class Staff { public $name; public $age; public $salary; public function __construct($name,$age,$salary=0) { $this->name=$name; $this->age=$age; $this->salary=$salary; } } $obj1 = new Staff('peter',20,4000); echo '我的姓名:'.$obj1->name,'我的年龄:'.$obj1->age,'我的工资是:'.$obj1->salary; echo '<hr>'; $objstr = serialize($obj1); echo '序列化的对象:'.$objstr;
2017-08-041个赞