I have an array in the following form,
Array
(
[0] => Array
(
[emailAddress] => abc@gmail.com
[subject] => Hi
[content] => How are you?
[attachment] => QmFzZTY0IGlzIGFuIGVuY29kaW5nIHNjaGVtZSB1c2VkIHRvIHJlcHJlc2VudCBiaW5hcnkgZGF0YSBpbiBhbiBBU0NJSSBmb3JtYXQuIA==
[fileName] => Base 64 Encoder
)
)
How could I have it on the following form:
Array
(
[emailAddress] => abc@gmail.com
[subject] => Hi
[content] => How are you?
[attachments] => Array
(
[attachment] => QmFzZTY0IGlzIGFuIGVuY29kaW5nIHNjaGVtZSB1c2VkIHRvIHJlcHJlc2VudCBiaW5hcnkgZGF0YSBpbiBhbiBBU0NJSSBmb3JtYXQu
[fileName] => Base 64 Encoder
)
)
And is there any way to convert the type of [attachments] => Array
to [attachments] => Object
? like below:
Array
(
[emailAddress] => abc@gmail.com
[subject] => Hi
[content] => How are you?
[attachments] => Object
(
[attachment] => QmFzZTY0IGlzIGFuIGVuY29kaW5nIHNjaGVtZSB1c2VkIHRvIHJlcHJlc2VudCBiaW5hcnkgZGF0YSBpbiBhbiBBU0NJSSBmb3JtYXQu
[fileName] => Base 64 Encoder
)
)
I've tried to look number of methods (like array_push, array_splice and etc.) but still can't get it. Hope someone can help me with that. Thanks.