0

I have an array and I want to convert array to json with php.

But my json_encode() function is that output:

$array = [
     'styles' => ['style'=>[]]
     ]; 


 {
     "stlyes":{
       "style":{
             0:{},
             1:{}
      }

}} 

//But it must be such
 {
     "stlyes":{
       "style":{},
       "style":{}

}}
user2342558
  • 5,567
  • 5
  • 33
  • 54
slddzz
  • 9
  • 2

0 Answers0