downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

JsonSerializable::jsonSerialize> <定義済み定数
[edit] Last updated: Fri, 25 May 2012

view this page in

JsonSerializable インターフェイス

(PHP 5 >= 5.4.0)

導入

JsonSerializable を実装したオブジェクトは、 json_encode() を呼んで処理されたときの自身の JSON 表現をカスタマイズできます。

インターフェイス概要

JsonSerializable {
/* メソッド */
abstract public mixed jsonSerialize ( void )
}

目次



add a note add a note User Contributed Notes JsonSerializable
Webdev 28-Apr-2012 07:36
The "encode everything in my class"-Code:

public function jsonSerialize()
{
    return get_object_vars($this);
}

 
show source | credits | sitemap | contact | advertising | mirror sites