我已经从数据库中的表中执行了数据,结果是
array(3) {
[0]=>
array(5) {
[0]=> string(1) "1"
["id_pegawai"]=> string(1) "1"
[1]=> string(1) "1"
["id_jabatan"]=> string(1) "1"
[2]=> string(1) "1"
["id_media"]=> string(1) "1"
[3]=> string(7) "Marjana"
["nama_pegawai"]=> string(7) "Marjana"
[4]=> string(8) "NIK.0001"
["nik"]=> string(8) "NIK.0001"
},
[1]=>
array(5) {
[0]=> string(1) "2"
["id_pegawai"]=> string(1) "2"
[1]=> string(1) "4"
["id_jabatan"]=> string(1) "4"
[2]=> string(1) "8"
["id_media"]=> string(1) "8"
[3]=> string(7) "Deny"
["nama_pegawai"]=> string(7) "Deny"
[4]=> string(8) "NIK.0007"
["nik"]=> string(8) "NIK.0007"
},
[2]=>
array(5) {
[0]=> string(1) "3"
["id_pegawai"]=> string(1) "3"
[1]=> string(1) "9"
["id_jabatan"]=> string(1) "9"
[2]=> string(1) "6"
["id_media"]=> string(1) "6"
[3]=> string(7) "Juny"
["nama_pegawai"]=> string(7) "Juny"
[4]=> string(8) "NIK.0011"
["nik"]=> string(8) "NIK.0011"
}
}
我想这样改变它:
array(3) {
[0]=>
array(5) {
[0]=> string(1) "1"
[1]=> string(1) "1"
[2]=> string(1) "1"
[3]=> string(7) "Marjana"
[4]=> string(8) "NIK.0001"
},
[1]=>
array(5) {
[0]=> string(1) "2"
[1]=> string(1) "4"
[2]=> string(1) "8"
[3]=> string(7) "Deny"
[4]=> string(8) "NIK.0007"
},
[2]=>
array(5) {
[0]=> string(1) "3"
[1]=> string(1) "9"
[2]=> string(1) "6"
[3]=> string(7) "Juny"
[4]=> string(8) "NIK.0011"
}
}
如何使用 assoc 删除数组?请帮助我,谢谢
注意:我不是使用 MYSQL,而是使用 ORACLE。我执行查询使用这样的代码:
$this->connection->executeQuery($sql, array($tanggalAwal, $tanggalAkhir), array(Type::DATETIME, Type::DATETIME))->fetchAll();