Printing a JSON array from Magento 2.4.4

Usually, the JSON can be printed using a simple logger but from Magento 2.4.4 onwards this will not print the array.

For that, we have to use

$logger->info(print_r($params,true));

(print_r($jsontobeprinted, true))

Var_dump can be also used for printing the contents in the variable.

Leave a comment

Your email address will not be published. Required fields are marked *