3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'id' => 1, 'expiry_date' => [ 'foo' => 'bar', 'count' => '(22)', ] ], [ 'id' => 2, 'expiry_date' => [ 'foo' => 'bar', 'count' => '(43)', ] ], [ 'id' => 3, 'expiry_date' => [ 'foo' => 'bar', 'count' => '(5)', ] ], [ 'id' => 4, 'expiry_date' => [ 'foo' => 'bar', 'count' => '(111)', ] ] ]; foreach ($array as $row) { $counts[] = (int) trim($row['expiry_date']['count'], '()'); } array_multisort($counts, $array); var_export($array);

preferences:
147.66 ms | 406 KiB | 5 Q