Kartenwerte von einem flachen Array zu einem anderen flachen Array

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Kartenwerte von einem flachen Array zu einem anderen flachen Array

by Anonymous » 01 Feb 2025, 10:03

Ich habe eine Reihe von Produkten und möchte sie mit einem anderen Array sortieren. < /p>

$products = array(
0 => 'Pro 1',
1 => 'Pro 2',
2 => 'Pro 3'
);

$sort = array(1,2,0);

array_multisort($products, $sort);
< /code>

Array sollte < /strong> jetzt sein ... < /p>

$products = array(
0 => 'Pro 2',
1 => 'Pro 3',
2 => 'Pro 1'
);
< /code>

Ich scheine Array_Multisort nicht richtig zu verwenden. Ich habe jetzt seit 2 Stunden unterschiedliche Wege ausprobiert ...

Top