How to use the dd function in Laravel 5.8 then expand spread out same the print_r() in PHP.

May 24, 2024

How to use the dd function in Laravel 5.8 then expand spread out same the print_r() in PHP.

There are 3 designs to choose from.

dd(var_export($testItemsDiff, true));
dd(json_encode($testItemsDiff, JSON_PRETTY_PRINT));
dd(print_r($testItemsDiff, true));

Thank you ChatGPT.