11-14-2007, 10:50 AM
|
#6 (permalink)
|
|
The Wanderer
Join Date: Nov 2007
Location: according to my wife: on the Net
Posts: 19
Thanks: 0
|
best-practice: $array[] = $item or array_push($array, $item)?
Since we talk about array_push here, I might as well ask the question here. What's better or faster ?
Code:
foreach ($complex_array as $key => $item) {
$array[] = $item;
}
or
Code:
foreach ($complex_array as $key => $item) {
array_push($array, $item);
}
Just a wondering of me...
|
|
|