8000 GitHub - truetone/Dict: A simple PHP class for Python dictionary-like functionality. · GitHub
[go: up one dir, main page]

Skip to content
truetonePublic

About

A simple PHP class for Python dictionary-like functionality.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

Simple PHP Dict

This is a simple PHP class to mimic some of the behavior of a Python dictionary.

Namely, easily storing and retrieving arbitrary data by key reference.

Usage

$data = ["foo" => "bar"];
$dict = new \UMN\CEHD\Dict\Dict($data);

$foo = $dict->get("foo"); // will be "bar"
$baz = $dict->get("baz"); // will be null
$json = $dict->toJSON(); // will be {"foo":"bar"} (string)

$array = $dict->toArray();

var_dump($array);

array(1) {
  'foo' =>
  string(3) "bar"
}

About

A simple PHP class for Python dictionary-like functionality.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0