print_r() on steroids. Includes output formatting, backtracing and javascript console support.
PHP
Switch branches/tags
Nothing to show
Pull request Compare This branch is 2 commits ahead of balaclark:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Foo.php
README.textile

README.textile

Foo

Foo is intended as a replacement for print_r and var_dump. It provides a richer
formatted output that can be output directly to the screen, or to a javascript
console.

Usage

Foo is comprised of 3 functions:

  • foo
  • foc
  • fo

Foo

Output data in any type (string / array / object, etc.) to the screen. Includes
a (minimised by default) full debug backtrace.

Arguments

mixed $bar Any array, object, string, number, boolean, etc.
string $title An optional title for the output, defaults to the object type
boolean $open Should the dislay be open or minimised by default?
boolean $console Output in the console or to the screen?

Foc

Output data in any type (string / array / object, etc.) to the javascript console.
This function a shortcut to running foo with no extra arguments in console mode.

mixed $bar Any array, object, string, number, boolean, etc.

Fo

Output data in any type (string / array / object, etc.) to the screen, minimal styling
and no backtracing.

mixed $bar Any array, object, string, number, boolean, etc.

License

Copyright 2010 Bala Clark

Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.