Phly\Mustache\Lexer::implodePregQuote PHP Method

implodePregQuote() protected method

Implode and preg_quote() an array of $pieces
protected implodePregQuote ( string $glue, array $pieces, string $delimiter = null ) : string
$glue string String to join $pieces with
$pieces array Strings to be quoted then joined
$delimiter string The delimiter required by PCRE functions If included, it will also be escaped
return string
    protected function implodePregQuote($glue, array $pieces, $delimiter = null)
    {
        foreach ($pieces as &$p) {
            $p = preg_quote($p, $delimiter);
        }
        return implode($glue, $pieces);
    }