<?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 "";
|
}
|
}
|
?>
|