PHPackages                             emeraldion/tramezzino - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. emeraldion/tramezzino

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

emeraldion/tramezzino
=====================

Converts a list of strings into a compact, readable representation with delimiters of choice

0775[1 issues](https://github.com/emeraldion/tramezzino/issues)PHP

Since Jul 5Pushed 2y agoCompare

[ Source](https://github.com/emeraldion/tramezzino)[ Packagist](https://packagist.org/packages/emeraldion/tramezzino)[ RSS](/packages/emeraldion-tramezzino/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/9df4ea9aacadeaad0dc3d05ca711a427bf696e4e013c0c076781070d679cac16/68747470733a2f2f7472617669732d63692e6f72672f656d6572616c64696f6e2f7472616d657a7a696e6f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/emeraldion/tramezzino)[![Coverage Status](https://camo.githubusercontent.com/e862b2093c2c9ed9569b730a44528b1e62c33e48add3782d41f8b4e94b07c203/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f656d6572616c64696f6e2f7472616d657a7a696e6f2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/emeraldion/tramezzino?branch=master)[![Latest Unstable Version](https://camo.githubusercontent.com/f8dc088f72475c931d54a8ebcbce3f22a74b3e7a5cecf0ee028f50b7207736a1/68747470733a2f2f706f7365722e707567782e6f72672f656d6572616c64696f6e2f7472616d657a7a696e6f2f762f756e737461626c65)](https://packagist.org/packages/emeraldion/tramezzino)[![composer.lock](https://camo.githubusercontent.com/40ae9e71846d322a24ae7368af9356ad77a82bb31b6f1acaa6e9520c319dc824/68747470733a2f2f706f7365722e707567782e6f72672f656d6572616c64696f6e2f7472616d657a7a696e6f2f636f6d706f7365726c6f636b)](https://packagist.org/packages/emeraldion/tramezzino)[![Total Downloads](https://camo.githubusercontent.com/69cb9b3589da3f1d5ce5b3ce72a3e109a8cb257761370a77e147993c89f696dd/68747470733a2f2f706f7365722e707567782e6f72672f656d6572616c64696f6e2f7472616d657a7a696e6f2f646f776e6c6f616473)](https://packagist.org/packages/emeraldion/tramezzino)[![Monthly Downloads](https://camo.githubusercontent.com/01b9b58ece65a40ad29567bdc5d06f060c1e8298e4792b2aad847dab896033b5/68747470733a2f2f706f7365722e707567782e6f72672f656d6572616c64696f6e2f7472616d657a7a696e6f2f642f6d6f6e74686c79)](https://packagist.org/packages/emeraldion/tramezzino)

tramezzino
==========

[](#tramezzino)

Converts a list of strings into a compact, readable representation with delimiters of choice

```
tramezzino.php 'alba,albero,albergo,alberto'
# => alb(a|er(go|o|to))

tramezzino.php 'aria:arianna' ':' '[' '+' ']'
# => aria[+nna]

```

What?
-----

[](#what)

In Italian, [tramezzino](https://it.wiktionary.org/wiki/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](https://npm.im/sarnie).

Why?
----

[](#why)

Useful when you need to pass long lists of URL params

Composer
--------

[](#composer)

Add it to your PHP project using [Composer](https://getcomposer.org):

```
composer require emeraldion/tramezzino
```

Then have it your way:

```
