本文整理汇总了PHP中Number::getNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP Number::getNumber方法的具体用法?PHP Number::getNumber怎么用?PHP Number::getNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Number
的用法示例。
在下文中一共展示了Number::getNumber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter_input
$cfg->infoMessage = '<h3>Contest invitation failed!</h3> <p>Please try again later.</p>';
}
} else {
$cfg->infoMessage = $thisPage->showError($errorArr);
}
}
//Refered Visitor's Handler
if (filter_input(INPUT_GET, "referer") != NULL && filter_input(INPUT_GET, "invitee") != NULL) {
$entrantObj->email = Entrant::getSingle($dbObj, 'email', filter_input(INPUT_GET, "referer", FILTER_VALIDATE_INT));
$entrantObj->friends = filter_input(INPUT_GET, "invitee") ? filter_input(INPUT_GET, "invitee") : "";
$entrantObj->contest = $thisContestId;
$friendNamesList = Entrant::getSingle($dbObj, 'names', $entrantObj->email);
$friendEmailsList = Entrant::getSingle($dbObj, 'friends', $entrantObj->email);
$friendEmailsArr = explode(",", $friendEmailsList);
$friendNamesArr = explode(",", $friendNamesList);
$inviteeName = $friendNamesArr[array_search(trim($entrantObj->friends), $friendEmailsArr)];
//strrpos($friendNamesList, $friendNamesArr[array_search(trim($entrantObj->friends), $friendEmailsArr)]."[m]");
if (in_array(trim($entrantObj->friends), $friendEmailsArr) && !strrpos($inviteeName, "[m]")) {
if ($entrantObj->emailExists() == true) {
//Existing Entrant handler
$entrantObj->point = Number::getNumber($contestObj->point) + Entrant::getSingle($dbObj, 'point', $entrantObj->email);
//fetch current point
$entrantObj->updateSingleRaw($dbObj, "point", $entrantObj->point, $entrantObj->email);
$entrantObj->updateSingleRaw($dbObj, "names", str_ireplace($inviteeName, $inviteeName . "[m]", $friendNamesList), $entrantObj->email);
}
}
$thisPage->redirectTo(SITE_URL . "contest/{$contestObj->id}/" . StringManipulator::slugify($contestObj->title) . "/");
}
include 'includes/other-settings.php';
$thisPage->author = $cfg->author;
include $cfg->templateLoc . $cfg->templateName . '/index.php';
示例2: it_can_be_cast_to_int
/**
* @test
*/
public function it_can_be_cast_to_int()
{
$number = new Number(5);
$this->assertEquals(5, $number->getNumber());
}