Avatar of benwiggy
benwiggyFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

Sort array

How can I sort the following array so that it is sorted by the first of the two values, in descending order? (i.e. 16, 10, 1)

Array
(
    [0] => stdClass Object
        (
            [name] => undefined
            [values] => Array
                (
                    [0] => 16
                    [1] => 0
                )

        )

    [1] => stdClass Object
        (
            [name] => GBP
            [values] => Array
                (
                    [0] => 1
                    [1] => 0.01
                )

        )

    [2] => stdClass Object
        (
            [name] => EUR
            [values] => Array
                (
                    [0] => 10
                    [1] => 2.37
                )

        )

)

Open in new window

PHP

Avatar of undefined
Last Comment
Ray Paseur
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of benwiggy
benwiggy
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

perfect, thank you :)
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Glad to help!  Thanks for the points and best of luck with your project, ~Ray
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo