Sort array with multiple keys
<p>All,</p>

<p>I have the following array in array format. The JSON format is shown just for user-friendliness. How can I sort the array ascending with the key "name" in php?</p>

<pre><code>            "food":
            [
                {
                    "id": 1,
                    "name": "dessert"
                },
                {
                    "id": 2,
                    "name": "maincourse"
                },
                {
                    "id": 3,
                    "name": "entrees"
                },
                {
                    "id": 4,
                    "name": "appetizers"
                }
            ]
</code></pre>

<p>The desired result is an array like this:</p>

<pre><code>            "food":
            [
                {
                    "id": 4,
                    "name": "appetizers"
                },
                {
                    "id": 1,
                    "name": "dessert"
                },
                {
                    "id": 3,
                    "name": "entrees"
                },
                {
                    "id": 2,
                    "name": "maincourse"
                }
            ]
</code></pre>
