src/Ubiquity/utils/http/USession.php
public static function addOrRemoveValueFromArray($arrayKey, $value, $add = null) {
		$array = self::getArray ( $arrayKey );
		$_SESSION [$arrayKey] = $array;
		$search = array_search ( $value, $array );
		if ($search === FALSE && $add) {
			$_SESSION [$arrayKey] [] = $value;
			return true;
		} else if ($add !== true) {
			unset ( $_SESSION [$arrayKey] [$search] );
			$_SESSION [$arrayKey] = array_values ( $_SESSION [$arrayKey] );
			return false;
		}
	}
public static function addOrRemoveValueFromArray($arrayKey, $value, $add = null) {
		$array = self::getArray ( $arrayKey );
		$_SESSION [$arrayKey] = $array;
		$search = array_search ( $value, $array );
		if ($search === FALSE && $add) {
			$_SESSION [$arrayKey] [] = $value;
			return true;
		} else if ($add !== true) {
			unset ( $_SESSION [$arrayKey] [$search] );
			$_SESSION [$arrayKey] = array_values ( $_SESSION [$arrayKey] );
			return false;
		}
	}
public static function addOrRemoveValueFromArray ( $ arrayKey , $ value , $ add = null ) { $ array = self :: getArray ( $ arrayKey ) ; $ _SESSION [ $ arrayKey ] = $ array ; $ search = array_search ( $ value , $ array ) ; if ( $ search === FALSE && $ add ) { $ _SESSION [ $ arrayKey ] [ ] = $ value ; return true ; } else if ( $ add !== true ) { unset ( $ _SESSION [ $ arrayKey ] [ $ search ] ) ; $ _SESSION [ $ arrayKey ] = array_values ( $ _SESSION [ $ arrayKey ] ) ; return false ; } }
Adds or removes a value from an array in session

@param string $arrayKey
the key of the array to add or remove in
@param mixed $value
the value to add
@param boolean|null $add
If true, adds otherwise removes
@return boolean
Adds or removes a value from an array in session