I recently create a function to combine some arrays of associative arrays in a single array in response to a stackoverflow question stackoverflow question, where you can found more details about this.
I recently create a function to combine some arrays of associative arrays in a single array in response to a stackoverflow question, where you can found more details about this.
I recently create a function to combine some arrays of associative arrays in a single array in response to a stackoverflow question, where you can found more details about this.
- [0=>['title1'=>'Title 1'], 1=>['title2'=>'Title 2']];
[0=>['title1'=>'Title 1'], 1=>['title2'=>'Title 2']];
- [0=>['contn1'=>'Content 1'],1=>['contn2'=>'Content 2']];
[0=>['contn1'=>'Content 1'],1=>['contn2'=>'Content 2']];
[
[
0=>['title1'=>'Title 1','contn1'=>'Content 1'],
0=>['title1'=>'Title 1','contn1'=>'Content 1'],
1=>['title2'=>'Title 2','contn2'=>'Content 2']
1=>['title2'=>'Title 2','contn2'=>'Content 2']
]
]
- [0=>['title1'=>'Title 1'], 1=>['title2'=>'Title 2']];
- [0=>['contn1'=>'Content 1'],1=>['contn2'=>'Content 2']];
[
0=>['title1'=>'Title 1','contn1'=>'Content 1'],
1=>['title2'=>'Title 2','contn2'=>'Content 2']
]
[0=>['title1'=>'Title 1'], 1=>['title2'=>'Title 2']];
[0=>['contn1'=>'Content 1'],1=>['contn2'=>'Content 2']];
[
0=>['title1'=>'Title 1','contn1'=>'Content 1'],
1=>['title2'=>'Title 2','contn2'=>'Content 2']
]
The function works as expected, but I think their description is very obscure. In addition, i choose constant T_OBJECT_CAST
as option to convert each rows as object: someone can suggest a bestbetter predefined constants?
First of all (in the latest update), I check if the last argument is the predefined constant T_OBJECT_CAST
: if it is, I set $asObject
to True
, then I pop-it off the end of arguments array; now in the $args
variable I have an array with each passed arrays.
The function works as expected, but I think their description is very obscure. In addition, i choose constant T_OBJECT_CAST
as option to convert each rows as object: someone can suggest a best predefined constants?
First of all (in the latest update), I check if the last argument is the predefined constant T_OBJECT_CAST
: if it is, I set $asObject
to True
, then I pop-it off the end of arguments array; now in the $args
variable I have an array with each passed arrays.
The function works as expected, but I think their description is very obscure. In addition, i choose constant T_OBJECT_CAST
as option to convert each rows as object: someone can suggest a better predefined constants?
First of all, I check if the last argument is the predefined constant T_OBJECT_CAST
: if it is, I set $asObject
to True
, then I pop-it off the end of arguments array; now in the $args
variable I have an array with each passed arrays.
- 1.8k
- 1
- 14
- 34