我有一个以下数组,需要使用phpexcel写入excel我可以直接将数组写入excel。
array(9) {
[0] =>
array(4) {
'hostname' =>
string(7) 'Dibeesh'
'hostemail' =>
string(14) 'xxx@xx.in'
'hostcity' =>
string(12) 'Kochi, India'
'host' =>
string(4) 'host'
}
[1] =>
array(4) {
'inviteename' =>
string(5) 'Test1'
'inviteeemail' =>
string(12) 'xxx@xx.in'
'inviteecity' =>
string(12) 'Kochi, India'
'invitee' =>
string(7) 'invitee'
}
[2] =>
array(4) {
'inviteename' =>
string(8) 'Nishanth'
'inviteeemail' =>
string(18) 'xxx@xx.com'
'inviteecity' =>
string(5) 'Aluva'
'invitee' =>
string(7) 'invitee'
}
[3] =>
array(4) {
'inviteename' =>
string(9) 'Lal Mohan'
'inviteeemail' =>
string(10) 'xxx@xx.in'
'inviteecity' =>
string(12) 'Kochi, India'
'invitee' =>
string(7) 'invitee'
}
[4] =>
array(4) {
'inviteename' =>
string(6) 'Mahesh'
'inviteeemail' =>
string(14) 'xxx@xxx.com'
'inviteecity' =>
string(10) 'Tvm, INdia'
'invitee' =>
string(7) 'invitee'
}
[5] =>
array(4) {
'hostname' =>
string(9) 'Lal Mohan'
'hostemail' =>
string(10) 'xxx@xx.in'
'hostcity' =>
string(12) 'Kochi, India'
'host' =>
string(4) 'host'
}
[6] =>
array(4) {
'inviteename' =>
string(6) 'Arshad'
'inviteeemail' =>
string(13) 'xxx@xx.in'
'inviteecity' =>
string(12) 'Kochi, India'
'invitee' =>
string(7) 'invitee'
}
[7] =>
array(4) {
'inviteename' =>
string(5) 'Joyal'
'inviteeemail' =>
string(12) 'xxx@xx.in'
'inviteecity' =>
string(12) 'Kochi, India'
'invitee' =>
string(7) 'invitee'
}
[8] =>
array(4) {
'inviteename' =>
string(7) 'Dibeesh'
'inviteeemail' =>
string(14) 'xxx@xx.in'
'inviteecity' =>
string(12) 'Kochi, India'
'invitee' =>
string(7) 'invitee'
}
}
如何使用 phpexcel 将其写入 excel?请帮助我以下列格式写入 excel