Sorting Associative Arrays in PHP
$arr = [

'foo' => 'bar',
'faz' => 'baz'


array_multisort(array_column($arr, 'value'), SORT_ASC, $arr);

You can sort an associative array with one line of code as I did above. As a result, the array becomes sorted by the keys:

   'faz' => 'baz', 
   'foo' => 'bar' 


PHPStorm – Stop those accidental tab closures!

If you’re like me, you have probably had this happen. You go to click on one of the many tabs you have open in PHPStorm, only to accidentally click the X, and close it. ARGH!

Today I found a way to alleviate that pain. You can turn off the X!

  1. Under Preferences, search for Editor Tabs
  2. Locate Close button position:
  3. Set it to None

Now, to close a tab, you must either hit the keyboard shortcut, or right-click it. Either of those will be a deliberate action.