28 oktober 2010

VMWare Tools upgrading

After upgrading VMWare tools on a windows guest, run this:

set devmgr_show_nonpresent_devices=1
devmgmt.msc

then uninstall all devices that arent used any more.

7 oktober 2010

in_array++

function in_array_depth($needle,$haystack) {
if (!isset($needle) || !isset($haystack)) {
trigger_error("Nothing to do.");
}
else if (!is_array($haystack)) {
trigger_error("Input must be of type: array.");
}
else if ($needle == "") {
trigger_error("Searchstring must not be an empty string.");
}
else {
foreach ($haystack as $key => $array) {
if (is_array($array[key($array)])) {
return in_array_depth($needle,$array[key($array)]);
}
else if (strtoupper($array[key($array)]) == $needle) {
return true;
}
}
return false;
}
}