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

The JsonSerializable interface

(PHP 5 >= 5.4.0)

简介

Objects implementing JsonSerializable can customize their JSON representation when encoded with json_encode().

接口摘要

JsonSerializable {
/* 方法 */
abstract public mixed jsonSerialize ( void )
}

Table of Contents



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

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

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