I'm not sure if this is meant to be "$arry", but:
I was thinking that $arry should be $array...
Right, or am I wrong?
Satan
Code:
// ###################### Start array2bits #######################
// takes an array and returns the bitwise value
function convert_array_to_bits(&$arry, $_FIELDNAMES, $unset = 0)
{
$bits = 0;
foreach($_FIELDNAMES AS $fieldname => $bitvalue)
{
if ($arry["$fieldname"] == 1)
{
$bits += $bitvalue;
}
if ($unset)
{
unset($arry["$fieldname"]);
}
}
return $bits;
}
Right, or am I wrong?
Satan
Comment