HF RL Explorer

Sort an Array of Associative Arrays by Column Value in PHP

Sort an Array of Associative Arrays by Column Value in PHP: a task in Terminal-Lego-15k (Harbor dataset). You are given a PHP file containing an inventory array with associative array elements. Each element has a "type" (string) and "price" (float) field. Your task is to write a PHP script that…

The task

You are given a PHP file containing an inventory array with associative array elements. Each element has a "type" (string) and "price" (float) field. Your task is to write a PHP script that sorts this array by the "price" column in **descending order** (highest price first).

Part of PrimeIntellect/Terminal-Lego-15k.