Underscore.php -- a PHP Port of Underscore.js
Underscore.php puts all its functions into the
so it requires at least PHP 5.3.0.
Main differences to Underscore.js
- No Support for timer based functions (delay, debounce, defer,...) as they make no sense in a synchronous environment, such as Requests to PHP
_()is already taken by the
includeis a reserverd word in PHP
Everything you need for using Underscore.php is contained in the file
underscore.php in the projects repository. Just put this file somewhere
in your path and include the file in your code with
All functions are in contained in the
Underscore Namespace. You may want to alias
this Namespace to
_, by calling
use Underscore as _;.
Calls to functions then will look like this:
$result = _\first(array(1, 2, 3));.
Underscore.php is MIT licensed. Please see the included