<?php
クラスデモ{
protected $name;
protected $age;
protected $wages;
public function __construct($name,$age,$wages){
$this->name = $name;
$this- >age = $age;
$this->wages = $wages;
}
public function show() {
return "员工の姓名:{$this->name} 年龄:{$this->age} 工资:{$this->wages}";
}
}
$obj = 新しいデモ('ピーター',24,5000);
echo $obj-> show();
echo '<br />';
$arr = array(array('name'=>'jike ','年齢'=>18,'賃金'=>'500'),
array('名前'=>'ジケ','年齢'=>18,'賃金' =>'500'),);
foreach ($arr as $key => $value) {
if(is_array($value)){
foreach ($value as $key => $v) {
echo $key.'-'.$v.'<br>';
}
}
}
?>
##