Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は2つのJson配列を持っています:
$arrayA = array("avg" => '1',"shape" => 'hey'); $arrayB = array("avg" => '2',"shape" => 'trapezoid');
javascriptor asを使用してそれらを結合したいPHP:
javascript
PHP
arrayAB = {"avg":['1', '2'], "shape":[hey', 'trapezoid']};
$arrayA = array("avg" => "234","shape" => "hey"); $arrayB = array("avg" => "5678","shape" => "trapezoid"); $array3 = array(); foreach ($arrayA as $key => $value) { $array3[$key] = array($arrayA[$key], $arrayB[$key]); }