I need to create following json from php array using json_encode():
{
"Image":"wordpress",
"Env" :[
"VIRTUAL_HOST=domain.com"
],
"ExposedPorts":{
"8080":"80"
}
}
I get stuck at the ExposedPorts , please help. This is my php array but it does not work :
[
'Image'=> 'wordpress',
'Env' => [
"VIRTUAL_HOST=domain.com"
],
'ExposedPorts'=>json_encode(["8080"=>"80"],JSON_FORCE_OBJECT)
]