Please could you help me:
i have an array sorted by key:
$a['a'] = value;
$a['b'] = value;
$a['c'] = value;
$a['d'] = value;
$a['e'] = value;
I need reordeer this by this rule – take one field and put it on first place and another do not change
f.e.
$a['c'] = value;
$a['a'] = value;
$a['b'] = value;
$a['d'] = value;
$a['e'] = value;
or
$a['d'] = value;
$a['a'] = value;
$a['b'] = value;
$a['c'] = value;
$a['e'] = value;
I think you meant something like this:
You should use it in this way:
and you should get desired effect from your first example. Of course you may want to check if element exists in given array etc., but it’s up to you.