Web::subst PHP Method

subst() public method

Replace old headers with new elements
public subst ( array &$old, $new ) : null
$old array array
$new string|array
return null
    function subst(array &$old, $new)
    {
        if (is_string($new)) {
            $new = [$new];
        }
        foreach ($new as $hdr) {
            $old = preg_grep('/' . preg_quote(strstr($hdr, ':', TRUE), '/') . ':.+/', $old, PREG_GREP_INVERT);
            array_push($old, $hdr);
        }
    }