本文整理汇总了PHP中wp_iso_descrambler函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_iso_descrambler函数的具体用法?PHP wp_iso_descrambler怎么用?PHP wp_iso_descrambler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_iso_descrambler函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_decodes_iso_8859_1_rfc2047_q_encoding
function test_decodes_iso_8859_1_rfc2047_q_encoding()
{
$this->assertEquals("this is some text", wp_iso_descrambler("=?iso-8859-1?q?this=20is=20some=20text?="));
}
示例2: explode
$content_transfer_encoding = explode(';', $content_transfer_encoding);
$content_transfer_encoding = $content_transfer_encoding[0];
}
if ($content_type == 'multipart/alternative' && false !== strpos($line, 'boundary="') && '' == $boundary) {
$boundary = trim($line);
$boundary = explode('"', $boundary);
$boundary = $boundary[1];
}
if (preg_match('/Subject: /i', $line)) {
$subject = trim($line);
$subject = substr($subject, 9, strlen($subject) - 9);
// Captures any text in the subject before $phone_delim as the subject
if (function_exists('iconv_mime_decode')) {
$subject = iconv_mime_decode($subject, 2, get_option('blog_charset'));
} else {
$subject = wp_iso_descrambler($subject);
}
$subject = explode($phone_delim, $subject);
$subject = $subject[0];
}
/*
* Set the author using the email address (From or Reply-To, the last used)
* otherwise use the site admin.
*/
if (!$author_found && preg_match('/^(From|Reply-To): /', $line)) {
if (preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches)) {
$author = $matches[0];
} else {
$author = trim($line);
}
$author = sanitize_email($author);
示例3: getlist
function getlist($mail_server, $mail_port, $mail_user, $mail_pass, $max = 10)
{
$maillists = array();
$phone_delim = '::';
$pop3 = new POP3();
if (!$pop3->connect($mail_server, $mail_port) || !$pop3->user($mail_user) || !($count = $pop3->pass($mail_pass))) {
$pop3->quit();
$this->error = 0 === $count ? 'There doesn’t seem to be any new mail.' : $pop3->ERROR;
return false;
}
$this->count = $count;
var_dump($count);
//if($count > $max )$count = $max;
for ($i = $count; $i > $count - 1; $i--) {
$message = $pop3->get($i);
/*foreach($message as $m=>$n){
//$n=iconv_mime_decode($n, 2, "gbk");
$n=base64_decode($n);
$n=mb_convert_encoding($n, 'gbk', 'gbk');
var_dump($n);
if(strpos($n,'http://bbs.scol.com.cn/member.php')!==FALSE){
var_dump($n);
}
if(strpos($n,'(如果上面不')!==FALSE){
var_dump($n);
}
//$n=mb_convert_encoding($n, 'gbk', 'gbk');
}*/
/*for($j=0;$j<=sizeof($message);$j++){
$message[$j]=base64_decode($message[$j]);
}*/
var_dump(base64_decode($message[42]));
var_dump(substr(base64_decode($message[41]), 12));
var_dump(substr(base64_decode($message[42]), 0, -12));
$bf = substr(base64_decode($message[41]), 17);
$af = trim(substr(base64_decode($message[42]), 0, -20));
//$url=substr(base64_decode($message[43]),12)+substr(base64_decode($message[44]),0,-12);
var_dump($bf . $af);
$all = str_replace("\n", '', $bf . $af);
$all = str_replace(">", "", $all);
$all = str_replace("&", "&", $all);
//$snoopy->fetch($bf.$af);
//$re =mb_convert_encoding($snoopy->results,"utf-8","gbk");
//print_r($re);
//sleep(10);
//echo "。";
//echo "<br/>";
$bodysignal = false;
$boundary = '';
$charset = '';
$content = '';
$content_type = '';
$content_transfer_encoding = '';
$post_author = 1;
foreach ((array) $message as $line) {
//var_dump($line);
// body signal
if (strlen($line) < 3) {
$bodysignal = true;
}
if ($bodysignal) {
$content .= $line;
} else {
if (preg_match('/Content-Type: /i', $line)) {
$content_type = trim($line);
$content_type = substr($content_type, 14, strlen($content_type) - 14);
$content_type = explode(';', $content_type);
if (!empty($content_type[1])) {
$charset = explode('=', $content_type[1]);
$charset = !empty($charset[1]) ? trim($charset[1]) : '';
}
$content_type = $content_type[0];
}
if (preg_match('/Content-Transfer-Encoding: /i', $line)) {
$content_transfer_encoding = trim($line);
$content_transfer_encoding = substr($content_transfer_encoding, 27, strlen($content_transfer_encoding) - 27);
$content_transfer_encoding = explode(';', $content_transfer_encoding);
$content_transfer_encoding = $content_transfer_encoding[0];
}
if ($content_type == 'multipart/alternative' && false !== strpos($line, 'boundary="') && '' == $boundary) {
$boundary = trim($line);
$boundary = explode('"', $boundary);
$boundary = $boundary[1];
}
if (preg_match('/Subject: /i', $line)) {
$subject = trim($line);
$subject = substr($subject, 9, strlen($subject) - 9);
// Captures any text in the subject before $phone_delim as the subject
if (function_exists('iconv_mime_decode')) {
$subject = iconv_mime_decode($subject, 2, "UTF-8");
} else {
$subject = wp_iso_descrambler($subject);
}
$subject = explode($phone_delim, $subject);
$subject = $subject[0];
}
// Set the author using the email address (From or Reply-To, the last used)
//.........这里部分代码省略.........