hxp
2025-06-04 f4a514d5ac952110da846636ecbb9de951eaf3d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
 
#´´½¨ÈÕÆÚ£º2012-5-21 ÏÂÎç4:24:03
#×÷Õߣºzhouliang
 
class AuthorityInfo
{
    private $m_arrayInfo=array();
    function __construct()
    {
 
    }
 
    #Ôö¼Ó´æ´¢µÄÄÚÈÝ(×¢Ò⣺Èç¹ûÏàͬµÄKey,еÄÄÚÈÝ»áÈ¡´ú¾ÉµÄÄÚÈÝ)
    public function AddInfo( $strKey, $strValue )
    {
        $this->m_arrayInfo[$strKey]=$strValue;
    }
 
    #Èç¹û´æÔÚ£¬ËµÃ÷Õâ¸öÖ¸Áî¿ÉÒÔͨ¹ý
    public function IsExist( $strKey, $strValue )
    {
        if( !array_key_exists($strKey, $this->m_arrayInfo ) )
        {
            var_dump($this->m_arrayInfo);
            return false;
        }
        
    
        $arrayResult=explode( ",", $this->m_arrayInfo[$strKey] );
        
        
        foreach ( $arrayResult as $strResultArrayKey=>$strResultArrayValue )
        {
            if( $strValue===$strResultArrayValue )
            {
                return true;
            }
        }
    
        return false;
    }
    
    public function GetKeyFromValue( $strValue )
    {
        foreach ( $this->m_arrayInfo as $arrayKey=>$arrayValue )
        {
            $arrayResult=explode( ",", $arrayValue );
            
            foreach ( $arrayResult as $strResultArrayKey=>$strResultArrayValue )
            {
                if( $strValue===$strResultArrayValue )
                {
                    return $arrayKey;
                }
            }
        }
        
        return "";
    }
}
?>