I can't find any real documentation on the quoted-printable-encode stream filter, but I've gathered info from several places. It seems there are 4 options that can be passed in the param array as in my other note on this subject:
line-length: integer, simply sets line length before a soft break is inserted
line-break-chars: Which char or chars to consider as a line break - note that "\r\n" will only match CRLF, not CR or LF, so make sure it matches your content.
binary: boolean, hex encodes all control chars, including spaces and line breaks, but leaves alphanumerics untouched
force-encode-first: Forcibly hex-encodes the first char on each line, even if it's alphanumeric. This is useful for avoiding corruption in some incompetent mail servers, like Exchange.
Akım İşlevleri
İçindekiler
- set_socket_blocking — Takma Adı: stream_set_blocking
- stream_bucket_append — Zincirin sonuna bir biriktirici ekler
- stream_bucket_make_writeable — Üzerinde işlem yapmak için zincirden bir biriktirici nesnesi döndürür
- stream_bucket_new — Geçerli akımda kullanmak için yeni bir biriktirici oluşturur
- stream_bucket_prepend — Zincirin önüne bir biriktirici ekler
- stream_context_create — Bir akım bağlamı oluşturur
- stream_context_get_default — Öntanımlı akım bağlamını döndürür
- stream_context_get_options — Bir akım/sarmalayıcı/bağlam için atanmış seçenekleri döndürür
- stream_context_get_params — Bir bağlamın değiştirgelerini döndürür
- stream_context_set_default — Akımları içeren öntanımlı bağlamı tanımlar
- stream_context_set_option — Bir akım/sarmalayıcı/bağlam için bir seçenek tanımlar
- stream_context_set_params — Bir akım/sarmalayıcı/bağlam için değiştirgeleri tanımlar
- stream_copy_to_stream — Veriyi bir akımdan diğerine kopyalar
- stream_encoding — Akımı kodlayacak karakter kümesini belirler
- stream_filter_append — Süzgeç zincirinin sonuna bir süzgeç ekler
- stream_filter_prepend — Süzgeç zincirinin başına bir süzgeç ekler
- stream_filter_register — Kullanıcı tanımlı bir akım süzgecini etkin kılar
- stream_filter_remove — Akımdan bir süzgeci kaldırır
- stream_get_contents — Akımdan kalanı bir dizgeye okur
- stream_get_filters — Etkin süzgeçlerin listesini döndürür
- stream_get_line — Akımdan belirtilen ayraca kadar bir satır döndürür
- stream_get_meta_data — Akımdan başlıkları/meta verileri döndürür
- stream_get_transports — Etkin soket aktarımlarının listesini döndürür
- stream_get_wrappers — Etkin akımların listesini döndürür
- stream_is_local — Akım, bir yerel akımsa TRUE döner
- stream_notification_callback — notification bağlam değiştirgesi için bir geri çağırım işlevi
- stream_register_wrapper — stream_wrapper_register işlevinin takma adıdır
- stream_resolve_include_path — Bir göreli yol ile yapılacak fopen çağrısıyla açılacak dosyayı belirler
- stream_select — Belirtilen akım dizisi üzerinde belirtilen zaman aşımı ile select() sistem çağrısının eşdeğeri olarak çalışır
- stream_set_blocking — Akımın engelleme kipini ayarlar
- stream_set_chunk_size — Set the stream chunk size
- stream_set_read_buffer — Set read file buffering on the given stream
- stream_set_timeout — Akımın zaman aşımı süresini ayarlar
- stream_set_write_buffer — Dosya tamponunu ayarlar
- stream_socket_accept — stream_socket_server ile oluşturulmuş bir soketten bağlantı kabul eder
- stream_socket_client — Bir Genel Ağ veya Unix alan soketi bağlantısı açar
- stream_socket_enable_crypto — Bağlı bir soket üzerinde şifrelemeyi açıp kapatır
- stream_socket_get_name — Yerel veya uzak soketin ismini döndürür
- stream_socket_pair — Soket akımlarınca ayırt edilebilen bir bağlantı çifti oluşturur
- stream_socket_recvfrom — Bağlı olsun ya da olmasın bir soketten veri alır
- stream_socket_sendto — Bir sokete bağlı olsun ya da olmasın, bir ileti gönderir
- stream_socket_server — Bir Genel Ağ veya Unix alan sunucusu soketi oluşturur
- stream_socket_shutdown — Çift yönlü bağlantıyı kapatır
- stream_supports_lock — Akımın kilitlemeyi destekleyip desteklemediğine bakar
- stream_wrapper_register — Bir PHP sınıfı olarak gerçeklenmiş bir URL sarmalayıcısını etkin kılar
- stream_wrapper_restore — İptal edilmiş yerleşik bir sarmalayıcıyı tekrar etkin kılar
- stream_wrapper_unregister — Bir URL sarmalayıcısını iptal eder
marcus at synchromedia dot co dot uk
16-Nov-2007 12:13
marcus at synchromedia dot co dot uk
30-Oct-2006 07:16
As this article says, there is no quoted_printable_encode function() in PHP: http://www.zend.com/manual/filters.convert.php
However there is a stream filter for quoted printable encoding. Here's an example function that produces output suitable for email and doesn't explicitly use external files (though it might do for strings over 2Mb due to the nature of the temp stream type):
<?php
function quoted_printable_encode($string) {
$fp = fopen('php://temp/', 'r+');
$params = array('line-length' => 70, 'line-break-chars' => "\r\n");
stream_filter_append($fp, 'convert.quoted-printable-encode', STREAM_FILTER_READ, $params);
fputs($fp, $string);
rewind($fp);
return stream_get_contents($fp);
}
echo quoted_printable_encode(str_repeat("hello there ", 50)." a=1\r\n")."\n";
?>
The filter needs to be restricted to STREAM_FILTER_READ because by default it will get filtered both going into and out of the stream, and will thus get encoded twice.
It should be much faster than using a PHP implementation of the same thing, though note that this will only work in PHP 5.1+.
jausions at php dot net
16-May-2006 05:59
For the "notification" index of the $params for stream_context_set_params() function, a callable function is accepted. That is array(&$object, 'methodName') will also work.
