Skip to content
Advertisement

Warning: Array to string conversion base64_encode

When I do this $payload2 = base64_encode($payload); I will get message “Expected type : string” so I change to $payload2 = base64_encode((string)$payload); but I will get the “Warning: Array to string conversion” error. How to solve this error?

JavaScript

Solution of using json_encode:

JavaScript

Advertisement

Answer

Solved by using implode()

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement