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.
1 parent fa2c7ae commit 41a9f50Copy full SHA for 41a9f50
encode.php
@@ -0,0 +1,24 @@
1
+<?php
2
+// https://github.com/BaseMax/php-jwt-example
3
+require 'vendor/autoload.php';
4
+use \Firebase\JWT\JWT;
5
+use \Firebase\JWT\SignatureInvalidException;
6
+$key = '83aeee518617ad6f3393bf0685e37d3e';
7
+
8
+// JSON
9
+$data=[
10
+ "status"=>"success",
11
+ "data1"=>"test1",
12
+ "data2"=>"test2",
13
+ "data3"=>"test3",
14
+ "data4"=>"test4",
15
+ "data5"=>"test5",
16
+];
17
+$data = json_encode($data);
18
+$jwt = JWT::encode($data, $key, 'HS256');
19
+print $jwt."\n";
20
21
+// plain text
22
+$data = "Hello, World!";
23
24
0 commit comments