Jump to content
php.lv forumi

funkcija, kura sakarto masivu augosha seciba


Recommended Posts

Posted

Sveiki PHP.

 

Nāku pie Jums ar lūgu padalīties informācijā / skriptā kā sakārtot masīvu

 array (
 [vertiba_0] => 35
 [vertiba_1] => 12
 [vertiba_2] => 22
 [vertiba_3] => 62
 [vertiba_4] => 43
 [vertiba_5] => 31
 [vertiba_6] => 27
);

augošā secībā

 array (
 [vertiba_0] => 12
 [vertiba_1] => 22
 [vertiba_2] => 27
 [vertiba_3] => 31
 [vertiba_4] => 35
 [vertiba_5] => 43
 [vertiba_6] => 62
);

 

ceru uz atsaucību.

Posted

sort?

Tev tās atslēgu vērtības arī svarīgas? Tad izvelc vispirms atslēgas un vērtības atsevišķi, tad sakārto ar sort vērtības un tad saliec kopā atpakaļ tās atslēgas ar jaunajām vērtībām.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...