· 7 years ago · Aug 17, 2018, 01:32 PM
1Unexpected control character found
2
3try {
4 $secretKey = 'hayderZainCash';
5 $headers = apache_request_headers();
6 $token = $headers['Authorization'];
7 $credintials = JWT::decode($token, $secretKey, array('HS256'));
8 echo $credintials;
9 } catch (Exception $e) {
10 echo 'error ' . $e->getMessage();
11 }
12
13preg_match('/Bearers(S+)/', $headers['Authorization'], $matches);
14$token = $matches[0];
15
16try
17{
18 $secretKey = 'hayderZainCash';
19 $headers = apache_request_headers();
20 preg_match('/Bearers(S+)/', $headers['Authorization'], $matches);
21 $credintials = JWT::decode($matches[0], $secretKey, array('HS256'));
22
23 print_r($credintials);
24}
25catch( Exception $e )
26{
27 echo 'error ' . $e->getMessage();
28}