當前位置: 首頁>>代碼示例>>PHP>>正文


PHP messages::create方法代碼示例

本文整理匯總了PHP中messages::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP messages::create方法的具體用法?PHP messages::create怎麽用?PHP messages::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在messages的用法示例。


在下文中一共展示了messages::create方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: explode

$to2 = explode("\n", $to1[1]);
$to = str_replace('>', '', str_replace('<', '', $to2[0]));
$to = explode(" ", $to);
foreach ($to as $toField) {
    if (filter_var($toField, FILTER_VALIDATE_EMAIL)) {
        $to = $toField;
        break;
    }
}
$message1 = explode("\n\n", $email);
$start = count($message1) - 3;
if ($start < 1) {
    $start = 1;
}
//Parse "message"
$message2 = explode("\n\n", $message1[$start]);
$message = $message2[0];
//Parse "from"
$from1 = explode("\nFrom: ", $email);
$from2 = explode("\n", $from1[1]);
if (strpos($from2[0], '<') !== false) {
    $from3 = explode('<', $from2[0]);
    $from4 = explode('>', $from3[1]);
    $from = $from4[0];
} else {
    $from = $from2[0];
}
//$email = str_replace("\n", "<br />", $email);
//$email = str_replace("\r", "<br />", $email);
$messages->create($to, $from, $subject, $email);
開發者ID:gmathis96,項目名稱:MailDud,代碼行數:30,代碼來源:mailpipe.php

示例2: array

    $messageText = preg_replace('/\\s+/', ' ', $messageText);
    //replace all white spaces to one space
    $messageText = helper::escapeText($messageText);
    $messageImg = helper::clearText($messageImg);
    $messageImg = helper::escapeText($messageImg);
    $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
    $auth = new auth($dbo);
    if (!$auth->authorize($accountId, $accessToken)) {
        api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
    }
    $profile = new profile($dbo, $profileId);
    $profile->setRequestFrom($accountId);
    $profileInfo = $profile->get();
    if ($profileInfo['state'] != ACCOUNT_STATE_ENABLED) {
        echo json_encode($result);
        exit;
    }
    if ($profileInfo['allowMessages'] == 0 && $profileInfo['follower'] === false) {
        echo json_encode($result);
        exit;
    }
    $blacklist = new blacklist($dbo);
    $blacklist->setRequestFrom($profileId);
    if (!$blacklist->isExists($accountId)) {
        $messages = new messages($dbo);
        $messages->setRequestFrom($accountId);
        $result = $messages->create($profileId, $chatId, $messageText, $messageImg);
    }
    echo json_encode($result);
    exit;
}
開發者ID:JohnWilliamsMSU,項目名稱:Steady,代碼行數:31,代碼來源:msg.new.inc.php


注:本文中的messages::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。