I have such an array.
Array( array( 'name' => 'title 1', 'price' => 200 'id' => '737362' ) array( 'name' => 'title 2', 'price' => 100 'id' => '737363' ))
Needed to sort by price. Here in the next topic I looked at the code:
usort($array, function($a, $b){ return ($a['price'] - $b['price']);});
The code works fine, no problem. But I can not understand how it works. Explain what's going on? Why do we deduct?