3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attribute_content[0]['term_id'] = 76; $attribute_content[0]['content'] = "ratio"; $attribute_content[1]['term_id'] = 18; $attribute_content[1]['content'] = "ideal condition"; $attribute_content[2]['term_id'] = 164; $attribute_content[2]['content'] = "genotype"; $attribute_content[3]['term_id'] = 218; $attribute_content[3]['content'] = "genetics"; $attribute_content[4]['term_id'] = 60; $attribute_content[4]['content'] = "height"; $order = array(18,164,218,60,76); $weights = array_flip($order); usort($attribute_content, function($x, $y) use($weights) { return $weights[$x['term_id']] - $weights[$y['term_id']]; }); var_dump($attribute_content);

preferences:
26.75 ms | 406 KiB | 5 Q