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> <Constantes pré-définies
[edit] Last updated: Fri, 25 May 2012

view this page in

L'interface JsonSerializable

(PHP 5 >= 5.4.0)

Introduction

Les objets implémentant l'interface JsonSerializable peuvent personnalisés leur représentation JSON lors de l'encodage avec la fonction json_encode().

Sommaire de l'Interface

JsonSerializable {
/* Méthodes */
abstract public mixed jsonSerialize ( void )
}

Sommaire



add a note add a note User Contributed Notes JsonSerializable
Webdev 29-Apr-2012 02: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