<?php
클래스 데모{
protected $name;
protected $age;
protected $wages;
공개 함수 __construct($name,$age,$wages){
$ this->name = $name;
$this->age = $age;
$this->wages = $wages;
}
공개 함수 show(){
return "员工的姓name是:{$this->name} 年龄:{$this->age} 工资:{$this->wages}";
}
}
$obj = 새로운 데모('peter',24,5000);
echo $obj->show();
echo '<br />';
$arr = array(array('name '=>'jike','age'=>18,'임금'=>'500'),
array('name'=>'jike','age'=>18,' 임금'=>'500'),);
foreach ($arr as $key => $value) {
if(is_array($value)){
foreach ($value as $key => ; $v) {
에코 $key.'-'.$v.'<br>';
}
}
}
?>