当前位置: 首页>>代码示例>>PHP>>正文


PHP Number::getNumber方法代码示例

本文整理汇总了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';
开发者ID:Mojolagbe2014,项目名称:mojokalokalo,代码行数:31,代码来源:contest.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());
 }
开发者ID:cultuurnet,项目名称:entry,代码行数:8,代码来源:NumberTest.php


注:本文中的Number::getNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。