0

Should I continue to use json_encode? Or use serialize class of Magento

\Zend_Json::encode this may be old, I don't think we should use this in higher Magento version

json_encode(something) Still see some usage across Magento system

Sometimes i see magento use

serializer->serialize(data)

serializer reference to class

\Magento\Framework\Serialize\Serializer\Json

I also found you can encode with use GuzzleHttp\json_encode

This makes me very confusing. So which is the method I should use?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.