Update Windows PATH without restarting

update your PATH variable, and then go into task manager and close all the explorer.exe processes.

Then go to File -> New Task -> explore.exe

That will restart Windows Explorer (and bring back the taskbar) with the new path

getting the first key of an array

I always have the problem with having an array that only has one key, and I want that key and the value, I used to use something like: foreach($arr as $key => $val){ $this->key = $key; $this->val = $val; } which is dumb, here is a much better way:

$arr = array('some_key_with_meaning' => 1);
first($arr);
$key = key($arr);
$val = $arr[$key];

to get the last key and value:
end($arr);
$key = key($arr);
$val = $arr[$key];
Feedback