, (*1)
tramezzino
Converts a list of strings into a compact, readable representation with delimiters of choice, (*2)
tramezzino.php 'alba,albero,albergo,alberto'
# => alb(a|er(go|o|to))
tramezzino.php 'aria:arianna' ':' '[' '+' ']'
# => aria[+nna]
What?
In Italian, tramezzino means sandwich. The name hints at the strings being sliced and interleaved with bread, the delimiters. Tramezzino is the PHP port of the Node module sarnie., (*3)
Why?
Useful when you need to pass long lists of URL params, (*4)
Composer
Add it to your PHP project using Composer:, (*5)
composer require emeraldion/tramezzino
Then have it your way:, (*6)
License
MIT, (*7)
Copyright (c) 2017-2023, Claudio Procida, (*8)