PHP code example of sunveloper / radic-tmp-underscore-php
1. Go to this page and download the library: Download sunveloper/radic-tmp-underscore-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sunveloper / radic-tmp-underscore-php example snippets
use Underscore\Types\Arrays;
$array = array(1, 2, 3);
// One-off calls to helpers
Arrays::each($array, function($value) { return $value * $value; }) // Square the array
Function::once($myFunction) // Only allow the function to be called once
Number::paddingLeft(5, 5) // Returns '00005'
Object::methods($myObject) // Return the object's methods
String::length('foobar') // Returns 6
// Or chain calls with the 'from' method
Arrays::from($array)->filter(...)->sort(...)->get(2)
// Which does this in the background
$array = new Arrays($array);
$array->filter(...)->sort(...)->get(2)
Arrays::diff($array, $array2, $array3) // Calls `array_diff`
Arrays::from($array)->diff($array2, $array3)->merge($array4) // Calls `array_diff` then `array_merge` on the result
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.