I have very simple question, how to convert this strings to JSON ?
This string i am getting from Guzzle POST Request and here is code :
return $body->getBody()->getContents();
Result:
""k\n\n{\"success\":true,\"payload\":{\"id\":\"txn_ngS2aS9FY7raxy8JTUivAZCtWJy7EeznwPE8\"}}""
with var_dump result and what is that k before ?
string(79) "k {"success":true,"payload":{"id":"txn_eeM6T6Fvkq3Pr4AWtK2TKYmNwKmodNwVqJod"}}"
The string is already json_encoded, you should simply return the $body->getBody()->getContents().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With