note 109338 added to jsonserializable.jsonserialize
| From: | RafiqueMohammed | Date: | Sun, 08 Jul 2012 02:05:27 +0000 |
| Subject: | note 109338 added to jsonserializable.jsonserialize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189065@lists.php.net to get a copy of this message | ||
class MySerializableClass implements JsonSerializable
{
public $a=2;
private $b=4;
public function JsonSerialize() {
return array('a'=>$this->a, 'b'=>$this->b,
'c'=>3);
}
}
$MySerializeInstance = new MySerializableClass();
print json_encode($MySerializeInstance);
----
Server IP: 69.147.83.197
Probable Submitter: 27.106.83.24 (proxied: 27.106.83.24)
----
Manual Page -- http://www.php.net/manual/en/jsonserializable.jsonserialize.php
Edit -- https://master.php.net/note/edit/109338
Del: integrated -- https://master.php.net/note/delete/109338/integrated
Del: useless -- https://master.php.net/note/delete/109338/useless
Del: bad code -- https://master.php.net/note/delete/109338/bad+code
Del: spam -- https://master.php.net/note/delete/109338/spam
Del: non-english -- https://master.php.net/note/delete/109338/non-english
Del: in docs -- https://master.php.net/note/delete/109338/in+docs
Del: other reasons-- https://master.php.net/note/delete/109338
Reject -- https://master.php.net/note/reject/109338
Search -- https://master.php.net/manage/user-notes.php