Created
April 12, 2011 02:04
-
-
Save joshuapowell/914783 to your computer and use it in GitHub Desktop.
Display an array in a readable format, preserving the whitespace, formatting as code, and displaying inside of a Message box.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Display an array in a readable format, preserving the whitespace, | |
* formatting as code, and displaying inside of a Message box. This can | |
* be placed inside of any function within a Drupal module or theme. | |
* This is primarily used during troubleshooting and should never be | |
* used on a production website. | |
* | |
* @param $array | |
* Represents array to be displayed, this could be a node object for instance | |
*/ | |
drupal_set_message('<code><pre>' . print_r($array, TRUE) . '</pre></code>'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment