scotfl.ca

Is Set And True

/** Check if a given index is present in an array, has a value, and is not false.

    @param $array the array
    @param $index the index

    @return boolean
*/
function isat ($array, $index)
{
    return is_array($array)  &&  array_key_exists($index, $array)  &&
        isset($array[$index])  &&  $array[$index];
}

This entry was posted on 10 March 2007 at 01:04 and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.