Skip to content
Advertisement

How to process the Azure REST API response in PHP

I am getting the below response with Azure rest API

JavaScript

I want to add the value of the key Name in Array in PHP how can I do that. I have tried this code but I can only able to print.

JavaScript

Once I am able to add the names in an array I will use that array to populate the drop down list in my application.

Can any PHP expert help here.

Advertisement

Answer

Once you get valid JSON (I removed the last , from your JSON so it is valid) you can use array_​column to “return the values from a single column in the input array“:

JavaScript

will output:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement