Building App in Ionic and webservices in PHP. My issue is I am getting an object from the app while hitting the api.
[option] => stdClass Object
(
[228] => 19
[229] => 22
[230] => 24
[231] => 26
)
In php I convert this object to array using the following code..
$option = (array)$this->request->post['option'];
Then I check its type, it is an array. But When I am trying to get the value of $option[228]
it returns me an error "Undefined Offset:228". The issue may be it is finding the index value 228 rather than matching the associative key value..
How I can get the value using these numeric keys??