I have the following array from $_POST:
array {
["item"]=> array() {
[0]=> "pen"
[1]=> "pencil"
[2]=> "ruler"
array {
["note"]=> array() {
[0]=> "permanent"
[1]=> "not so permanent"
[2]=> "measures stuff"
array {
["cost"]=> array() {
[0]=> "67.99"
[1]=> ".15"
[2]=> "1.49"
That I want to combine into single line items, e.g
array {
["line_items"]=> array() {
["0"]=> array() {
[item]=> "pen"
[note]=> "permanent"
[cost]=> "67.99"
["1"]=> array() {
[item]=> "pencil"
[note]=> "not so permanent"
[cost]=> ".15"
["3"]=> array() {
[item]=> "ruler"
[note]=> "measures stuff"
[cost]=> "1.49"
I've had a look at array_merge, array_merge_recursive, array_combine, but all these functions don't do what i'm looking for. I've tried a few different for each and for loops, but I just can't get my head around it.
Please ask if you need more info, this isn't very clear, but like i say, my head - struggling to get around this.