I\'m using MAMP on Windows to start a web server for my WordPress website. I want to debug some PHP code (at least write variable values to log/browser console/anywhere else
If you want to debug WordPress, just turn on debug mode. Add this into your wp-config
file instead of this one define( 'WP_DEBUG', false );
Add this code:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Next step is just using this one:
error_log(print_r($args,true));
Your $args
you'll see in the {your-local-website-path}/wp-content/debug.log
file