samedi 9 juin 2018

Convert array laravel

I use Laravel framework and I have an array:

[▼
  "0.022" => "24.00000000"
  "0.013" => "506.00000000"
  "0.041" => "65.00000000"
]

Could you help me to convert it to new format like this:

[▼
  0 => {▼
    "xxx": 0.022
    "yyy": 24.00000000
  }
  1 => {▼
    "xxx": 0.013
    "yyy": 506.00000000
  }
  2 => {▼
    "xxx": 0.041
    "yyy": 65.00000000
  }
]

Thank you very much.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire