I need to sort a multidimensional array by a the column reference. The problem is that the reference has '-', so reference is alphanumeric.
Example:
array(
0 =>['other_value' => y, 'reference' => '423-52', 'other_value' => x],
1 =>['other_value' => y, 'reference' => '223-52', 'other_value' => x],
2 =>['other_value' => y, 'reference' => '5423-52', 'other_value' => x],
3 =>['other_value' => y, 'reference' => '823-52', 'other_value' => x],
4 =>['other_value' => y, 'reference' => '123-52', 'other_value' => x]
)
Expected sorted result:
array(
0 =>['other_value' => y, 'reference' => '123-52', 'other_value' => x],
1 =>['other_value' => y, 'reference' => '223-52', 'other_value' => x],
2 =>['other_value' => y, 'reference' => '423-52', 'other_value' => x],
3 =>['other_value' => y, 'reference' => '823-52', 'other_value' => x],
4 =>['other_value' => y, 'reference' => '5423-52', 'other_value' => x]
)