note 109337 added to class.jsonserializable
| From: | ar dot rafiq at live dot com | Date: | Sun, 08 Jul 2012 02:04:41 +0000 |
| Subject: | note 109337 added to class.jsonserializable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189064@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/class.jsonserializable.php
Edit -- https://master.php.net/note/edit/109337
Del: integrated -- https://master.php.net/note/delete/109337/integrated
Del: useless -- https://master.php.net/note/delete/109337/useless
Del: bad code -- https://master.php.net/note/delete/109337/bad+code
Del: spam -- https://master.php.net/note/delete/109337/spam
Del: non-english -- https://master.php.net/note/delete/109337/non-english
Del: in docs -- https://master.php.net/note/delete/109337/in+docs
Del: other reasons-- https://master.php.net/note/delete/109337
Reject -- https://master.php.net/note/reject/109337
Search -- https://master.php.net/manage/user-notes.php