Defining multidimensional array while storing form data in JSON format in php -
i have convert form data json format. trying achieve this:-
{"appconfiguration" : { "configuration_name" = "as400 configuration", "configuration_version" = "1.001", "connection" : [ { "ip_address" : [ “10.10.10.01”, “10.10.10.02”, “10.10.10.03” // saved ip address. ] "port" : "23" "ssl" : "no", "device_name" : "agicent device", "name" : "puga", "user" : "smart gladiator", "password" : "sgl2013", "barcode_enter" : "no",]}}
this json should like. able store data in single-dimension array; how create structure this?
"connection":["ohiuh","ghu","ip_address":["something","something","something"]]
try this
$arr = array('connection'=>array("ohiuh","ghu" , json_encode(array("ip_address"=>array("something","something","something"))))); echo json_encode($arr);
Comments
Post a Comment