Php 2D key value pair array, how to add elements

php QR key value pair array, how to add elements

$data = [["ts"=>5,"zl"=>105,"je"=>5000],["ts"=>1,"zl"=>22,"je"=>1000],["ts"=>2,"zl"=>50,"je"=>1300]];

$abc =  [["ts"=>1,"zl"=>20,"je"=>1000],["ts"=>2,"zl"=>40,"je"=>2000]];

how does God add the $abc array to the $data array? Thank you!

Php
Oct.09,2021

array_merge ($data,$abc)


$data[] = $abc[0];
$data[] = $abc[1];

I wonder if you want to add two subarrays of $abc to $data?

Menu