I have a program where I receive a string at the input and store it line by line in the field, for example list [0] = 'Roll 5CZK', etc .. I also have a function that finds the value from the string (number, here 5). How can I sort this field. I don't want to solve it with a 2D array
$string='Rohlík 5Kč
CZK400 Knížka
Pivo 42,-
Houska 4 Kč';
$list = explode(PHP_EOL, $string);
getPrice($list[1]); // => 400
getPrice($list[2]; // => 42