src/Email.php
public static function addressBuildString($addresses)
    {
        $addresses = self::addressesGet($addresses);
        $addressesNew = array();
        foreach ($addresses as $k => $v) {
            $name = null;
            if (is_int($k)) {
                $address = $v;
            } else {
                $name = $v;
                $address = $k;
            }
            if (!isset($_SERVER['WINDIR']) && $name) {
                if (strpos($name, ',')) {
                    $name = addcslashes($name, '()');
                    $name = '"'.$name.'"';
                }
                $address = $name.' <'.$address.'>';
            }
            $addressesNew[] = $address;
        }
        return implode(', ', $addressesNew);
    }
public static function addressBuildString($addresses)
    {
        $addresses = self::addressesGet($addresses);
        $addressesNew = array();
        foreach ($addresses as $k => $v) {
            $name = null;
            if (is_int($k)) {
                $address = $v;
            } else {
                $name = $v;
                $address = $k;
            }
            if (!isset($_SERVER['WINDIR']) && $name) {
                if (strpos($name, ',')) {
                    $name = addcslashes($name, '()');
                    $name = '"'.$name.'"';
                }
                $address = $name.' <'.$address.'>';
            }
            $addressesNew[] = $address;
        }
        return implode(', ', $addressesNew);
    }
public static function addressBuildString ( $ addresses ) { $ addresses = self :: addressesGet ( $ addresses ) ; $ addressesNew = array ( ) ; foreach ( $ addresses as $ k => $ v ) { $ name = null ; if ( is_int ( $ k ) ) { $ address = $ v ; } else { $ name = $ v ; $ address = $ k ; } if ( ! isset ( $ _SERVER [ 'WINDIR' ] ) && $ name ) { if ( strpos ( $ name , ',' ) ) { $ name = addcslashes ( $ name , '()' ) ; $ name = '"' . $ name . '"' ; } $ address = $ name . ' <' . $ address . '>' ; } $ addressesNew [ ] = $ address ; } return implode ( ', ' , $ addressesNew ) ; }
Returns email address string

@param mixed $addresses addresses string or array

@return string
Returns email address string