本文整理汇总了PHP中Misc::isEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::isEmail方法的具体用法?PHP Misc::isEmail怎么用?PHP Misc::isEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Misc
的用法示例。
在下文中一共展示了Misc::isEmail方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveAndEndForetagsTavling_krillo_debug
/**
* debug only, stripped version of Foretag.saveAndEndForetagsTavling()
* only printout
*/
function saveAndEndForetagsTavling_krillo_debug()
{
$emailName = "Tavling avslutad - tisdag";
global $db;
$sql = 'SELECT a.id FROM mm_medlem a, mm_foretagsnycklar b, mm_foretag c
WHERE a.id = b.medlem_id
AND b.foretag_id = c.id
AND a.epostBekraftad = 1
AND UNIX_TIMESTAMP(c.startDatum) >= ' . (time() - (Foretag::TAVLINGSPERIOD_DAGAR + 3) * 86400) . ' AND UNIX_TIMESTAMP(c.startDatum) < ' . (time() - Foretag::TAVLINGSPERIOD_DAGAR * 86400);
$unixtimestamp_first = time() - (Foretag::TAVLINGSPERIOD_DAGAR + 3) * 86400;
$unixtimestamp_second = time() - Foretag::TAVLINGSPERIOD_DAGAR * 86400;
echo "unixtimestamp_first : " . $unixtimestamp_first . " | " . date("Y-m-d", $unixtimestamp_first) . "<br/>";
echo "unixtimestamp_second : " . $unixtimestamp_second . " | " . date("Y-m-d", $unixtimestamp_second) . "<br/><br/>";
$slutDatum = date("Y-m-d", time());
$slutDatum = Misc::dateToTimestamp($slutDatum);
$tavling = new Tavling('0000-00-00');
$save = array();
foreach ($db->valuesAsArray($sql) as $user) {
$medlem = Medlem::loadById($user);
if (isset($medlem)) {
$slutVecka = strftime("%V", $slutDatum);
$foretagsSlutVecka = strftime("%V", Misc::dateToTimestamp($medlem->getForetag()->getSlutdatum()));
echo "{$slutVecka}: " . $slutVecka . " | " . "{$foretagsSlutVecka}: " . $foretagsSlutVecka . "<br>";
if (Misc::isEmail($medlem->getEpost(), false) && $medlem->getForetag() && $medlem->getLag()) {
//self::logEmailSend(false, $emailName, "try", $medlem);
echo " " . $medlem->getForetag()->getNamn() . " " . $medlem->getForetag()->getNamn() . " | epost: " . $medlem->getEpost() . "<br/>";
}
}
}
}
示例2: isEmailAdvanced
function isEmailAdvanced($label, $value, $msg = NULL, $error_level = TRUE)
{
//Debug::text('Raw Email: '. $value, __FILE__, __LINE__, __METHOD__, $this->verbosity);
if (Misc::isEmail($value, TRUE, $error_level) === TRUE) {
return TRUE;
}
$this->Error($label, $msg, $value);
return FALSE;
}
示例3: setEpost
public function setEpost($epost)
{
if ($this->getId()) {
Security::demand(USER, $this);
}
global $db;
if (!Misc::isEmail($epost)) {
throw new MedlemException("Ogiltig e-postadress", -3);
}
if ($this->getId()) {
$sql = "SELECT epost FROM " . $this->getTable() . " WHERE epost = '" . Security::secure_data($epost) . "' ";
if ($this->getId()) {
$sql .= "AND id <> " . $this->getId();
}
if ($db->value($sql) != "") {
throw new MedlemException("E-postadressen är upptagen", -6);
}
}
$this->epost = $epost;
// TODO: Bekräfta epost
}
示例4: array
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
if (isset($_POST['email'])) {
$sendMails = array();
$faultyMails = array();
$mailExistsAsMember = array();
$mailExistsAsTip = array();
$maxBatchSize = 5;
$currentBatchCount = 0;
foreach ($_POST['email'] as $email) {
$count = 0;
if (!empty($email) && Misc::isEmail($email)) {
$count = $db->allValuesAsArray('select id, anamn as username from mm_medlem where epost = "' . mysql_real_escape_string(trim($email)) . '" limit 1;');
if (empty($count)) {
$count = $db->nonquery('select * from mm_inbjudningar where epost = "' . mysql_real_escape_string($email) . '" limit 1;');
if ($count == 0) {
$sendMails[] = $email;
} else {
$mailExistsAsTip[] = $email;
}
} else {
foreach ($count as $key => $value) {
$mailExistsAsMember[] = $arrayName = array('email' => $email, 'id' => $count[$key]['id'], 'username' => $count[$key]['username']);
}
}
} else {
if (!empty($email)) {
$faultyMails[] = $email;
}
}