1. Go to this page and download the library: Download hallindavid/manny 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/ */
hallindavid / manny example snippets
use Manny;
Manny::phone("8008008000"); // Returns: 800-800-8000
use Manny;
Manny::phone("8008008000"); // Returns: 800-800-8000
//US Social Security Number
Manny::mask("987654321", "111-11-1111"); //returns "987-65-4321"
//US Zip-code
Manny::mask("The whitehouse zip code is: 20500", "11111"); //returns "20500"
//Canada Postal Code
Manny::mask("K1M1M4", "A1A 1A1"); //
//outputs 987-65-4321
/**
* @param array $target - should be key-val associative array
* @param array $elements - should be flat array with desired key names from target array
* @param array $defaults (optional) - key-val associative array which will be appended to extracted key-value pairs before returning
* @return array
*/
function yoink($target, $elements, $defaults = null)
/**
* @param string $text - the subject of our stripping
* @param array|null $options - an array with the return types you'd like
*
* keys can dot - keep periods
* dash - keep dashes/hyphens
* space - keep spaces
* underscore - keep underscores
* pipe - keep pipe characters
* bracket - keep square brackets []
* parenthesis - keep parenthesis ()
* curly - keep curley braces (useful for handlebar syntax ex. {{ thing }}
*
* @return string
*/
function stripper($text, $options = null)
$string = 'With only 5-10 hours of development, Dave built Manny, saving him atleast 10 seconds per day!';
$config = ['num', 'alpha', 'space'];
Manny::stripper($string,$config);
//Returns: 'With only 510 hours of development Dave built Manny saving him atleast 10 seconds per day';
$alt_config = ['num'];
Manny::stripper($string,$alt_config);
//Returns: '51010';
$string = 'I only want to "keep" the alpha, num, and spaces for this string!';
$options = ['alpha', 'num', 'space']
Manny::keep()
//Returns: 'I only want to keep the alpha num and spaces for this string'
/**
* @param string $text - the subject of our crumbling
* @param array $crumbs - an array of positive integers
* @param bool $appendExtra - keys can