I just released util.php

I just released my latest project, util.php to GitHub. Util.php is a single file that you can include in any of your projects without worrying about conflicts, since it’s entirely contained within the class util. The project includes dozens of functions (Over 40 right now) that most developers either need or use very frequently. It’s especially useful for small one-off projects that don’t warrant a framework that would normally include these methods.

It includes an extremely powerful alternative to print_r/var_dump that can be executed on variables of any type, and will show you the variable’s type, size, contents and more depending on the type of variable. It supports displaying arrays and objects, and includes some JavaScript that allows you to expand/collapse nested array elements within the variable. Here’s a screenshot of the function, util::var_dump( $var ):

util::var_dump() in action

The library also includes functions like array_pluck, array_first, array_last, get_var/post_var/request_var/etc (Retrieves a value from the superglobals but lets you specify a default if they aren’t set). If you’re interested in a complete list of the functions, take a look at the documentation I wrote.

The project includes a suite of unit tests as well. Please check it out, and feel free to submit issue reports, pull requests or fork it. I’ve already received 20 issue reports, had 15 forks and have 70+ watchers on GitHub!

2 Replies to “I just released util.php”

  1. Does it have any features for mySQL and all.

    How does one create things like these man??

  2. That is insane dude good work keep it up

    +1 mr CC

Leave a Reply