To easily debug the value of a variable in Horde PHP code, Horde::debug() can be used. Usage:
<?php Horde::debug($variable); ?>
$variable is the variable you wish to debug. The contents of this variable will be dumped into a file named horde_debug.txt in your temporary directory (generally set in horde/config/conf.php in the $conf['tmpdir'] variable).
If you want to manually specify the location of the debug file, you can use the optional second parameter to Horde::debug():
<?php Horde::debug($variable, $filename); ?>
$filename should be the full path to the filename. If using $filename, make sure the directory/file is writable by the user the PHP process runs as.
It's worth noting that the output will also include a debug_backtrace(), so trying something like:<?php Horde::debug(debug_backtrace()); ?>
will likely cause issues.