この形式の配列があります...
[User] => Array
(
[Oct 09] => Array
(
[10] => 1
[8] => 0
[9] => 0
[7] => 0
[6] => 0
)
[Oct 10] => Array
(
[10] => 0
[8] => 1
[9] => 0
[7] => 0
[6] => 0
)
[Oct 11] => Array
(
[10] => 1
[8] => 0
[9] => 1
[7] => 1
[6] => 1
)
)
ループを使用せずに配列を解析して、フォームに変換したい
[User]=>array
(
[0] =>array(
[date] => OCt 09
[user_id] => 10
[attendance] => 1
)
[1] =>array(
[date] => OCt 09
[user_id] => 8
[attendance] => 0
)
)
このように、解析に時間がかかるため、foreach や for ループを使用したくありません。組み込みの配列関数を使用したい。私が試したのは
public function parseAttendance($y){
return array("date", "user_id", "attendane"); // I want to return something like in this format.
}
public function admin_attendance() {
$result = array_map(array($this, 'parseAttendance'), $arr['User']);
print_r($result);
die();
}