Array display utility for both Human-readable and PHP code drop-in

/ Published in: PHP
Save to your folder(s)

# function *formatArrayForDisplay*

## parameters:

* **array**
a 1- or 2-dimensional array for output
* **mode**
accepts **human** or **PHP**
* **human** displays using `<pre>` tags and print_r
* **PHP** displays PHP style formatting for creating the same array using a PHP script, useful for unit tests when source data is needed.

## returns:

* **void**, all output is directed through **echo**

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.