The JsonSerializable interface

(PHP 5 >= 5.4.0, PHP 7, PHP 8)

Introduction

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

Interface synopsis

interface JsonSerializable {
/* Methods */
public jsonSerialize (): mixed
}

Table of Contents

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes

There are no user contributed notes for this page.

AltStyle によって変換されたページ (->オリジナル) /