function _existRem( &$array, $expkey, $expval=FALSE, $hitval=null ) {
    if( !is_array( $array ) || ( 0 == count( $array )))
      return null;
    if( !isset( $array[$expkey] ))
      return null;
    if( !$expval )
      return $hitval;
    if( $expval != $array[$expkey] )
      return null;
    unset( $array[$expkey] );
    return $hitval;
  }
function _existRem( &$array, $expkey, $expval=FALSE, $hitval=null ) {
    if( !is_array( $array ) || ( 0 == count( $array )))
      return null;
    if( !isset( $array[$expkey] ))
      return null;
    if( !$expval )
      return $hitval;
    if( $expval != $array[$expkey] )
      return null;
    unset( $array[$expkey] );
    return $hitval;
  }
function _existRem ( & $ array , $ expkey , $ expval = FALSE , $ hitval = null ) { if ( ! is_array ( $ array ) || ( 0 == count ( $ array ) ) ) return null ; if ( ! isset ( $ array [ $ expkey ] ) ) return null ; if ( ! $ expval ) return $ hitval ; if ( $ expval != $ array [ $ expkey ] ) return null ; unset ( $ array [ $ expkey ] ) ; return $ hitval ; }
if exist, remove key with expected value from array and return spec. value

@author Kjell-Inge Gustafsson <ical@kigkonsult.se>
@since 0.9.19 - 2007-03-18
@param array $array
@param string $expkey
@param string $expval
@param int $hitval optional
@return int
if exist remove key with expected value from array and return spec . value