Skip to content

PHP class for pretty-printing nested arrays/objects using HTML, CSS and JavaScript, providing buttons to expand/collapse each level

License

Notifications You must be signed in to change notification settings

kipras/ArrayHtml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

ArrayHtml

PHP class for pretty-printing nested arrays/objects using HTML, CSS and JavaScript, providing buttons to expand/collapse each level.

Supports printing recursive objects, i.e. objects that have children that point back to the parent object.

If a printed object has a __toArray() method - that method will be called and any additional data returned by it will be merged together with the data returned by get_object_vars() and pretty-printed.

Example screenshot:
ArrayHtml screenshot

Usage

  • ArrayHtml::show($data)
    Pretty-prints $data

  • ArrayHtml::get($data)
    Returns the pretty-printed HTML of $data

Requirements

  • PHP >= 5.3 (uses static:: keyword)

About

PHP class for pretty-printing nested arrays/objects using HTML, CSS and JavaScript, providing buttons to expand/collapse each level

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages