This is a discussion on code at first step change something for work with intesection within the alt.comp.lang.php forums, part of the PHP Programming Forums category; inner $arraytot I have more subarray that I can merge two a two with cicle: $result = array(); foreach($arraytot as $...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
inner $arraytot I have more subarray that I can merge two a two with cicle:
$result = array(); foreach($arraytot as $value) { $result = array_merge($result, $value); } but if I use array_intersect not work; this because I think at first iteration it does an intersection between $result that is a empty array and the 1st subarray, so the result is a void array and for the next iteration it will have always an intersection with a void array and the subarray; |