We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 53b3894 + e41b22a commit e525e0aCopy full SHA for e525e0a
README.md
@@ -203,6 +203,22 @@ $jwks = ['keys' => []];
203
JWT::decode($payload, JWK::parseKeySet($jwks));
204
```
205
206
+Miscellaneous
207
+-------------
208
+
209
+#### Casting to array
210
211
+The return value of `JWT::decode` is the generic PHP object `stdClass`. If you'd like to handle with arrays
212
+instead, you can do the following:
213
214
+```php
215
+// return type is stdClass
216
+$decoded = JWT::decode($payload, $keys);
217
218
+// cast to array
219
+$decoded = json_decode(json_encode($decoded), true);
220
+```
221
222
Changelog
223
---------
224
0 commit comments