Jump to content

moving array member to top


Confidence

Recommended Posts

hi,

if i have an array like this


Array
(
    [customers] => Private
    [tariffarray] => Array
        (
            [0] => Array
                (
                    [provider] => EnerGen Süd eG
                    [tarifName] => Privattarif

                    [topseller] => 

                )

            [1] => Array
                (
                    [provider] => energiehoch3 GmbH
                    [tarifName] => Strom³
                    [topseller] => 

                )

            [2] => Array
                (
                    [provider] => Energy2day GmbH
                    [tarifName] => RegioPlus50
                    [topseller] => 1


                )
                }
                }


 

and i want to move the element with

 

[topseller] => 1

 

to the top (position 0)...something like $myarray ['tariffarray'][0]

 

how do i do that?

 

Link to comment
https://forums.phpfreaks.com/topic/193045-moving-array-member-to-top/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.