4
I’m getting some data from a Webservice
, through a JSON response.
Convert this data from JSON to array
, through json_decode
. But one thing that’s bothering me is the fact the keys are coming with the name on Camelcase.
Something like this:
['Id' => 44, 'NumeroDoCliente' => 55, 'ProdutoCodigoNum' => 77]
My concern is that I once had a problem with the "excess of whim" (or disorganization, as you wish) on webservices where the data came in Camelcase. An example, id came as Id
, and then "refactored" to ID
, which caused a big problem for me, and stopped my system.
So I wanted to create a normalization of these indices, transforming them into upper case or Lower case.
Is there any way to change the "case" of the indexes in PHP? Is there any way to convert all the keys to upper case or Lower case?
Good. This saves part of my job +1
– Wallace Maxters
What’s missing? @Wallacemaxters
– Miguel
Finish processing the webservice data, kkkkkk. The rest leave with me here, thanks :D
– Wallace Maxters