- json_decode: documentation ( source)
- print_r: documentation ( source)
- array_merge: documentation ( source)
- json_encode: documentation ( source)
<?php
$select['clientChoice'] = '{"23" : {"13x18":"5","20X30":"5","30x45":"4","digital":"4"}}';
$clientChoice = array(42 => array("13x18" => 2, "20X30" => 1, "30x45" =>3 , "digital" => 1));
$tabs = json_decode($select['clientChoice'], true);
print_r($tabs);
$new = array_merge($tabs, $clientChoice);
print_r($new);
$new = $tabs + $clientChoice;
print_r($new);
$chosen = json_encode($new);