File tree Expand file tree Collapse file tree 1 file changed +21
-19
lines changed Expand file tree Collapse file tree 1 file changed +21
-19
lines changed Original file line number Diff line number Diff line change @@ -57,25 +57,27 @@ For more information see the [included man pages](http://drslump.github.com/Prot
57
57
58
58
## Example usage
59
59
60
- require_once 'DrSlump/Protobuf.php';
61
- \DrSlump\Protobuf::autoload();
62
-
63
- $person = new Tutorial\Person();
64
- $person->name = 'DrSlump';
65
- $person->setId(12);
66
-
67
- $book = new Tutorial\AddressBook();
68
- $book->addPerson($person);
69
-
70
- // Use default codec
71
- $data = $book->serialize();
72
-
73
- // Use custom codec
74
- $codec = new \DrSlump\Protobuf\Codec\Binary();
75
- $data = $codec->encode($book);
76
- // ... or ...
77
- $data = $book->serialize($codec);
78
-
60
+ ``` php
61
+ <?php
62
+ require_once 'DrSlump/Protobuf.php';
63
+ \DrSlump\Protobuf::autoload();
64
+
65
+ $person = new Tutorial\Person();
66
+ $person->name = 'DrSlump';
67
+ $person->setId(12);
68
+
69
+ $book = new Tutorial\AddressBook();
70
+ $book->addPerson($person);
71
+
72
+ // Use default codec
73
+ $data = $book->serialize();
74
+
75
+ // Use custom codec
76
+ $codec = new \DrSlump\Protobuf\Codec\Binary();
77
+ $data = $codec->encode($book);
78
+ // ... or ...
79
+ $data = $book->serialize($codec);
80
+ ```
79
81
80
82
## Installation
81
83
You can’t perform that action at this time.
0 commit comments