Oh sorry. It’s all 1 array to start with, but 2-dimensional, numerically indexed. I got you now. Threw me off with the title.
Are you only interested in the 0th element of the array, or are you wanting both elements of the original array? your OP is throwing me off because a ‘400’ and an extra ‘397’ appear out of nowhere.
Regardless, you should still be able to merge a 2-dimensional array using the splat operator: array_merge(... $originalarray)
@m_hutley hi, i’m currently facing a new problem (i managed to use array_unique function successfully but i face this problem)with my php loop. i couldn’t seem to increment in my foreach loop to get the value of an array.
here is my code:
OP, does this have to do with your other thread where you are trying to manually increment id’s? If so, you are focusing on fixing your attempted solution to the real problem that as far as I have seen, have not answered what that is.
Why are you trying to explode something that is already a singular thing?
$update_id1=Array ( [0] => 398 [1] => 397 [2] => 393 [3] => 391 [8] => ); foreach ($update_id1 as $i => $v) {
so, the first time through the loop, $i is 0, and $v is 398.
If you need to make update_id1 unique, do it outside your foreach, and then walk through the unique array, echoing the values.