This is my array
array(5) {
[0]=>
string(2) "10"
[1]=>
string(2) "22"
[2]=>
string(2) "25"
[3]=>
string(2) "37"
[4]=>
string(2) "38"
}
How to get it to array like this
array(1) {
[0]=>
string(2) "10"
}
array(2) {
[0]=>
string(2) "22"
}
array(3) {
[0]=>
string(2) "25"
}
array(4) {
[0]=>
string(2) "37"
}
array(5) {
[0]=>
string(2) "38"
}
I’m using this code
$sellerIds = * My Array *
if(is_array($sellerIds)){
foreach($sellerIds as $key => $value){
$sellerIds = $value;
}
}
// do something with $sellerIds
But when i var_dump it, it like this
string(2) "10"
string(2) "22"
...
Please Help Me ! Thanks All
2
Answers
Using array_chunk function :-
array_chunk