Php array merging problem

1 json data is string, but the data type is string.
2)); ciyu is $ciyu=array ("saoci" = > array) ("rookie tutorial", " master"
I want to merge $data and $ciyu into one array (multi-dimensional array)

Php
Mar.24,2021

the home page should first convert $data into an array json_decode ($data,true)
then use the php built-in function array_merge ($ciyu,$data)
, but your $data must also be a secondary array, if not you can use array_push ()


print ($data. the array cannot be output with print, it can be output with print_r, and cannot be used after the array. Concatenate strings

$data = '{"a":"haha", "b":"hehe"}';
$saoci = array("saoci"=>array("",""));

$data= json_decode($data,true);

var_dump($data);
$data=array_merge($data,$saoci);
print_r($data);

output:

array (size=2)
  'a' => string 'haha' (length=4)
  'b' => string 'hehe' (length=4)
Array ( [a] => haha [b] => hehe [saoci] => Array ( [0] =>  [1] =>  ) )
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45c20-59bab.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45c20-59bab.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?