Get array value by key.

@param array $aData
@param mixed $mKey
@param mixed $sDefault

@return string
329060
protected function _findInArray( array $aData, $mKey, $sDefault = '' )
    {
        $sVal = $sDefault;

        if ( array_key_exists( $mKey, $aData ) and is_scalar( $aData[$mKey] ) ) {
            $sVal = trim( (string) $aData[$mKey] );
        }

        return $sVal;
    }
1231935
private function getVarValue($sKey, $aVars)
    {
        foreach ($aVars as $aVar) {
            if ($sKey == $aVar['key']) {
                return $aVar['value'];
            }
        }

        return null;
    }
567387
public static function inArrayMulti($sValue, $sKey, array $aArray): bool
    {
        return static::arraySearchMulti($sValue, $sKey, $aArray) !== false;
    }
401791
public function get($sKey, $sDefaultValue = null)
    {
        if (empty($sKey)) {
            return $sDefaultValue;
        }

        $obValue = Session::get($sKey, $sDefaultValue);

        return $obValue;
    }
953053
public static function get($array, $key, $default = null)
	{
		if (!static::accessible($array))
			return value($default);

		if (is_null($key))
			return $array;

		if (static::exists($array, $key))
			return $array[(string) $key];


		foreach (static::toKey($key) as $segment) {
			if (static::accessible($array) && static::exists($array, $segment)) {
				$array = $array[$segment];
			} else {
				return value($default);
			}
		}

		return $array;
	}
57615
protected function getCountCommonCompileWheres(array &$aData)
    {
        $oDb = Factory::service('Database');

        /**
         * Handle where's
         *
         * This is an array of the various type of where that can be passed in via $aData.
         * The first element is the key and the second is how multiple items within the
         * group should be glued together.
         *
         * Each type of where is grouped in it's own set of parenthesis, multiple groups
         * are glued together with ANDs
         */

        $aWheres = [
            'where'           => 'AND',
            'or_where'        => 'OR',
            'where_in'        => 'AND',
            'or_where_in'     => 'OR',
            'where_not_in'    => 'AND',
            'or_where_not_in' => 'OR',
        ];

        $aWhereCompiled = [];

        foreach ($aWheres as $sWhereType => $sWhereGlue) {

            if (!empty($aData[$sWhereType])) {

                $aWhereCompiled[$sWhereType] = [];

                if (is_array($aData[$sWhereType])) {

                    /**
                     * The value is an array. For each element we need to compile as appropriate
                     * and add to $aWhereCompiled.
                     */

                    foreach ($aData[$sWhereType] as $mWhere) {

                        if (is_string($mWhere)) {

                            /**
                             * The value is a straight up string, assume this is a compiled
                             * where string,
                             */

                            $aWhereCompiled[$sWhereType][] = $mWhere;

                        } else {

                            /**
                             * The value is an array, try and determine the various parts
                             * of the query. We use strings which are unlikely to be found
                             * as falsey values (such as null) are perfectly likely.
                             */

                            //  Work out column
                            $mColumn = isset($mWhere['column']) ? $mWhere['column'] : '[NAILS-COL-NOT-FOUND]';

                            if ($mColumn === '[NAILS-COL-NOT-FOUND]') {
                                $mColumn = isset($mWhere[0]) && is_string($mWhere[0]) ? $mWhere[0] : null;
                            }

                            //  Work out value
                            $mVal = isset($mWhere['value']) ? $mWhere['value'] : '[NAILS-VAL-NOT-FOUND]';

                            if ($mVal === '[NAILS-VAL-NOT-FOUND]') {
                                $mVal = isset($mWhere[1]) ? $mWhere[1] : null;
                            }

                            //  Escaped?
                            $bEscape = isset($mWhere['escape']) ? (bool) $mWhere['escape'] : '[NAILS-ESCAPE-NOT-FOUND]';

                            if ($bEscape === '[NAILS-ESCAPE-NOT-FOUND]') {
                                $bEscape = isset($mWhere[2]) ? $mWhere[2] : true;
                            }

                            //  If the $mColumn is an array then we should concat them together
                            if (is_array($mColumn)) {
                                $mColumn = 'CONCAT_WS(" ", ' . implode(',', $mColumn) . ')';
                            }

                            //  Test if there's an SQL operator
                            if (!(bool) preg_match('/(<|>|!|=|\sIS NULL|\sIS NOT NULL|\sEXISTS|\sBETWEEN|\sLIKE|\sIN\s*\(|\s)/i', trim($mColumn))) {
                                $sOperator = is_null($mVal) ? ' IS ' : '=';
                            } else {
                                $sOperator = '';
                            }

                            //  Got something?
                            if ($mColumn) {

                                switch ($sWhereType) {

                                    case 'where' :
                                    case 'or_where' :

                                        if ($bEscape) {
                                            $mVal = $oDb->escape($mVal);
                                        }

                                        $aWhereCompiled[$sWhereType][] = $mColumn . $sOperator . $mVal;
                                        break;

                                    case 'where_in' :
                                    case 'or_where_in' :

                                        if (!is_array($mVal)) {
                                            $mVal = (array) $mVal;
                                        }

                                        if (!empty($mVal)) {
                                            if ($bEscape) {
                                                foreach ($mVal as &$sValue) {
                                                    $sValue = $oDb->escape($sValue);
                                                }
                                            }

                                            $aWhereCompiled[$sWhereType][] = $mColumn . ' IN (' . implode(',', $mVal) . ')';
                                        }
                                        break;

                                    case 'where_not_in' :
                                    case 'or_where_not_in' :

                                        if (!is_array($mVal)) {
                                            $mVal = (array) $mVal;
                                        }

                                        if (!empty($mVal)) {
                                            if ($bEscape) {
                                                foreach ($mVal as &$sValue) {
                                                    $sValue = $oDb->escape($sValue);
                                                }
                                            }

                                            $aWhereCompiled[$sWhereType][] = $mColumn . ' NOT IN (' . implode(',', $mVal) . ')';
                                        }
                                        break;
                                }
                            }
                        }
                    }

                } elseif (is_string($aData[$sWhereType])) {

                    /**
                     * The value is a straight up string, assume this is a compiled
                     * where string,
                     */

                    $aWhereCompiled[$sWhereType][] = $aData[$sWhereType];
                }
            }
        }

        /**
         * Now we need to compile all the conditionals into one big super query.
         * $aWhereStr is an array of the compressed where strings... will make
         * sense shortly...
         */

        if (!empty($aWhereCompiled)) {

            $aWhereStr = [];

            foreach ($aWhereCompiled as $sWhereType => $sValue) {
                if (!empty($sValue)) {
                    $aWhereStr[] = '(' . implode(' ' . $aWheres[$sWhereType] . ' ', $sValue) . ')';
                }
            }

            //  And reduce $aWhereStr to an actual string, like the name suggests
            if (!empty($aWhereStr)) {
                $aWhereStr = implode(' AND ', $aWhereStr);
                $oDb->where($aWhereStr);
            }
        }
    }
122860
public static function get($mKeys = null, $bXssClean = false)
    {
        $aArray = isset($_GET) ? $_GET : [];
        return static::getItemsFromArray($mKeys, $bXssClean, $aArray);
    }
870109
public function get(string $name, $valueDefault = null)
    {
        return Arrays::get($_GET, $name, $valueDefault);
    }
1271233
public function getFromArray(string $key, array $data, string $default = null)
    {
        $value = $default;

        if (\array_key_exists($key, $data)) {
            $value = $data[$key];
        }

        return $value;
    }
1368650
public function getLanguageValues($asArray = null)
    {
        if (!$this->owner->getIsNewRecord() && $this->_languageValues === null) {
            $this->_languageValues = [];

            /* @var ActiveRecord $language */
            foreach ($this->owner->{$this->languageRelation} as $language) {
                $this->_languageValues[] = $language->getAttribute($this->languageValueAttribute);
            }
        }

        if ($asArray === null) {
            $asArray = $this->languageValuesAsArray;
        }

        if ($asArray) {
            return $this->_languageValues === null ? [] : $this->_languageValues;
        } else {
            return $this->_languageValues === null ? '' : implode(', ', $this->_languageValues);
        }
    }
703682
public function get($key, $valueDefault = null)
    {
        return Arrays::get($this->data, $key, $valueDefault);
    }
510589
public static function get(array $data, string $key, $defaultValue = null)
    {
        $data = self::dataByPath($data, $key);
        if ($data === null) {
            $data = $defaultValue;
        }
        return $data;
    }
688623
public static function get(array $data, $key, $default = null)
	{
		if ($key === null) {
			return $data;
		}

		if (is_array($key)) {
			return static::getArray($data, $key, $default);
		}

		foreach (explode('.', $key) as $segment) {
			if (!is_array($data)) {
				return $default;
			}

			if (!array_key_exists($segment, $data)) {
				return $default;
			}

			$data = $data[$segment];
		}

		return $data;
	}
535250
public function getValue(array $keys, $default = null)
    {
        $config = $this->config;
        $pointer = &$config;
        foreach ($keys as $key) {
            if (!array_key_exists($key, $pointer)) {
                if ($default === null) {
                    throw new InvalidArgumentException(sprintf(
                        'Key "%s" does not exist',
                        implode('.', $keys)
                    ));
                }
                return $default;
            }
            $pointer = &$pointer[$key];
        }
        return $pointer;
    }
832066
public static dnskey[] get(nitro_service service, String keyname[]) throws Exception{
		if (keyname !=null && keyname.length>0) {
			dnskey response[] = new dnskey[keyname.length];
			dnskey obj[] = new dnskey[keyname.length];
			for (int i=0;i<keyname.length;i++) {
				obj[i] = new dnskey();
				obj[i].set_keyname(keyname[i]);
				response[i] = (dnskey) obj[i].get_resource(service);
			}
			return response;
		}
		return null;
	}
267830
function getFromKeys(array $keys)
    {
        $realm = $this->getRealm();


        foreach ($keys as $i => $k)
            $keys[$i] = "'$k'";

        $keys = implode(', ', $keys);

        try {
            $sql = "SELECT * FROM `KVStore` WHERE `realm` = '$realm' and `key` IN ($keys);";

            $stm = $this->pdo->prepare($sql);
            $stm->execute();
            $stm->setFetchMode(\PDO::FETCH_ASSOC);

            $c = $stm->fetchAll();

            foreach ($c as $d) {
                $key     = $d['key'];
                $val     = $this->getDataInterchange()->retrieveBackward( $d['value'] );

                parent::set($key, $val);
                yield $key => $val;
            }

        } catch (\Exception $e) {
            throw new exReadError($e->getMessage(), $e->getCode(), $e);
        }
    }
8335
public function getByRef($sRef, $aData = [])
    {
        if (empty($aData['where'])) {
            $aData['where'] = [];
        }

        $aData['where'][] = [$this->sTableAlias . '.ref', $sRef];

        $aEmails = $this->getAll(null, null, $aData);

        return !empty($aEmails) ? reset($aEmails) : false;
    }