0

I have an API which has the request of this form.

stb_list:{"1":{"stb":"SDA4C123456790"}}

and here's my code in PHP:

$data1=array('stb' => 'SDA4C123456789');

$data2=array('1'=> $data1);

$data_array=array('stb_list'=>$data2);

$data_string=json_encode($data_array);

echo $data_string;


which gives this output: {"stb_list":{"1":{"stb":"SDA4C123456789"}}}


Now, I am really stuck with this for a while as the API provider has refused to guide me on this. I have tried all available options but couldn't frame a request of that form. So please help out in solving this issue and in learning something new.

Steve
  • 522
  • 3
  • 12
  • 28

0 Answers0