\Dictionary

Represents a collection of keys and values.To browse the .NET Framework source code for this type, see the Reference Source.

模拟VB.NET之中的字典对象,在字典之中的每一个元素对象都是 由{key, value}这样子的键值对所构成的

Summary

Methods
Properties
Constants
__get()
__set()
__construct()
__toString()
GetJson()
offsetSet()
offsetExists()
offsetUnset()
offsetGet()
SaveTo()
ToArray()
Keys()
Values()
ContainsKey()
Add()
From()
No public properties found
No constants found
No protected methods found
$__data
N/A
No private methods found
$container
$default
N/A

Properties

$__data

$__data : array

数组是序列对象的最基本数据存储结构对象

Type

array

$container

$container : 

Type

$default

$default : 

Type

Methods

__get()

__get(  $name) 

Parameters

$name

__set()

__set(  $name,   $value) 

Parameters

$name
$value

__construct()

__construct(  $table = NULL,   $default = null) 

使用默认的构造函数

Parameters

$table
$default

__toString()

__toString() 

这个函数定义当前的这个集合对象与字符串函数交互的默认行为

GetJson()

GetJson() 

将当前的这个字典对象序列化为json字符串,以返回给客户端浏览器

offsetSet()

offsetSet(  $offset,   $value) 

Gets or sets the value associated with the specified key.

Parameters

$offset
$value

offsetExists()

offsetExists(  $offset) 

Parameters

$offset

offsetUnset()

offsetUnset(  $offset) 

Parameters

$offset

offsetGet()

offsetGet(  $offset) 

Gets or sets the value associated with the specified key.

Parameters

$offset

SaveTo()

SaveTo(string  $path, array  $project = null, string  $encoding = "utf8") : boolean

Save this data collection as csv file

Parameters

string $path

The csv file path for save this collection object.

array $project

The csv file header mapping.

string $encoding

The text file content encoding, by default is utf8 encoding.

Returns

boolean

ToArray()

ToArray() : array

Copies the elements of the ``System.Collections.ArrayList`` to a new System.Object array.

Returns

array —

An System.Object array containing copies of the elements of the System.Collections.ArrayList.

Keys()

Keys() 

Gets a collection containing the keys in the System.Collections.Generic.Dictionary<T1,T2>.

获取当前的这个字典对象之中的所有的键值对的键名列表

Values()

Values() 

Gets a collection containing the values in the System.Collections.Generic.Dictionary<T1,T2>.

获取当前的这个字典对象之中的所有的键值对的值列表集合

ContainsKey()

ContainsKey(string  $key) : boolean

Determines whether the System.Collections.Generic.Dictionary<T1,T2> contains the specified key.

判断指定的键名是否存在于当前的字典对象之中

Parameters

string $key

The key to locate in the System.Collections.Generic.Dictionary<T1,T2>.

Returns

boolean —

true if the System.Collections.Generic.Dictionary<T1,T2> contains an element with the specified key; otherwise, false.

Add()

Add(  $key,   $value) 

向当前的字典对象之中添加一个键值对

Parameters

$key
$value

From()

From(  $table,   $default = null) 

Parameters

$table
$default