i have a piece of code that joins two arrays together in PHP like this
$array_1=[1,2,3,4]; //input 1
$array_2= ["a","b","c","d"];//input 2
$array_3= ["1 a", "2 b", "3 c", "4 d"]; //this is how my final array should look like
i tried using array merge but it did not do what i wanted it to do is there another function i can use to do this.
so basically i am trying to get the numbers from the array 1 and letters from the array 2 and join it together in array 3
in to a single array
Both square brackets and curly braces can be used interchangeably for accessing array elements (e.g. $array[42] and $array{42} will both do the same thing in the example above).