0

I am new to WordPress development and I am trying to teach myself how to build WordPress themes. Since PHP is a server side language, how do you display the outputs of the code to determine if it's executing properly and doing what you want and to debug it?

I have used Kint before, but wanted to know if there are other more useful tools.

Thanks for any help!

I Am Sir Ask Alot
  • 117
  • 1
  • 1
  • 9

1 Answers1

0

There is print_r which prints human-readable information about a variable.

https://www.php.net/manual/en/function.print-r.php

There is var_dump which dumps information about a variable

https://www.php.net/manual/en/function.var-dump.php

For more information about the difference between print_r and var_dump, see this question:

php var_dump() vs print_r()

WPhil
  • 1,056
  • 1
  • 7
  • 12