I have two arrays called $array1
and $array2
and var_dump
gives
array (size=1)
0 =>
array (size=5)
'userid' => string '8' (length=1)
'useremail' => string 'venkat@gmail' (length=12)
'username' => string 'venkatesh' (length=9)
'password' => string '1111' (length=4)
'Name' => string 'venkatesh' (length=9)
array (size=1)
'modenames' =>
array (size=3)
0 => string 'group 4' (length=7)
1 => string 'group 4' (length=7)
2 => string 'group 4' (length=7)
now i need to make a json something like this
{
"userid":"8",
"useremail":"venkat@gmail",
"username":"venkatesh",
"password":"1111",
"Name":"venkatesh",
"modenames":{"group 4","group 4","group 4"}
}
i have used array_merge() and $array1+$array2 both gives a json not in above format.. help me out.