atk14/dictionary

字典实现

v1.0 2019-01-08 09:36 UTC

This package is auto-updated.

Last update: 2024-09-08 22:46:12 UTC


README

在 ATK14 框架中使用的字典实现

基本用法

$dictionary = new Dictionary([
  "key1" => "val1",
  "key2" => "val2",
  "key3" => null, 
]);

$dictionary->getValue("key1"); // "val1"
$dictionary->getValue("key3"); // null
$dictionary->getValue("key4"); // null

$dictionary["key1"]; // "val1"
$dictionary["key3"]; // null
$dictionary["key4"]; // null

$dict->defined("key1")); // true
$dict->defined("key3")); // false
$dict->defined("key4")); // false

$dict->keyPresents("key3")); // true
$dict->keyPresents("key4")); // false

安装

使用 Composer 安装 Dictionary

cd path/to/your/project/
composer require atk14/dictionary

许可证

Dictionary 是在 MIT 许可证条款下分发的免费软件 https://open-source.org.cn/licenses/mit-license