Answer the question
In order to leave comments, you need to log in
Converting to PHP array?
You need this:
Transfer-Encoding: chunked
HTTP/1.1 200 OK
Server: nginx
Connection: keep-alive
Set-Cookie: test=asd; expires=Wed, 16-Jan-2019 07:50:54 GMT; path=/; domain=test.tssaltan.ru; httponly
Set-Cookie: test=asd; expires=Tue, 05-Feb-2019 07:50:54 GMT; path=/; domain=localhost; httponly
Set-Cookie: hello=world_832; expires=Tue, 05-Feb-2019 07:50:54 GMT
Set-Cookie: name=random_5c4c115ea048f; expires=Tue, 05-Feb-2019 07:50:54 GMT
Date: Sat, 26 Jan 2019 07:50:54 GMT
Content-Type: text/html; charset=UTF-8
Cookies send!
{"test.tssaltan.ru":{"hello":{"value":"world_832","expires":1.549353054E9},"name":{"value":"random_5c4c115ea048f","expires":1.549353054E9}},"localhost":{"test":{"value":"asd","expires":1.549353054E9}}}
Answer the question
In order to leave comments, you need to log in
json_decode
UPD:
Apparently I misunderstood the question. Try like thisjson_encode(['test.tssaltan.ru' => $_COOKIE]);
First parse php.net/manual/fa/function.http-parse-headers.php then convert to desired structure and json_encode
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question