本文整理汇总了PHP中XString::isValidPhoneNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP XString::isValidPhoneNumber方法的具体用法?PHP XString::isValidPhoneNumber怎么用?PHP XString::isValidPhoneNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XString
的用法示例。
在下文中一共展示了XString::isValidPhoneNumber方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkPhoneNumber
private function checkPhoneNumber(array $phones, $errorMsgs)
{/*{{{*/
$phones = array_filter($phones);
foreach ($phones as $phone)
{
if (false == XString::isValidPhoneNumber($phone))
{
$errorMsgs[] = "<span class='yellow'>电话号码({$phone})格式有问题</span>";
}
}
return $errorMsgs;
}/*}}}*/
示例2: applyHospitalized
public function applyHospitalized($request, $response)
{/*{{{*/
$user = UserClient::getInstance()->getCurrentUser();
if($user->isNull())
{
//$this->message("请您先登陆!", $response);
//return false;
}
$phone = $request->getRequest('phone', '');
if(empty($phone) || false == XString::isValidPhoneNumber($phone))
{
$this->message("请输入正确的联系电话", $response);
return false;
}
$hospitalName = $request->getRequest('hospitalName', '');
if (empty($hospitalName))
{
$referer = $_SERVER['HTTP_REFERER'];
$hospitalName=$referer;
}
$content = "医院信息: $hospitalName\n\n联系电话: $phone\n\n病情信息:".$request->getRequest('content', '');
UserClient::getInstance()->addUserAdvice('住院直通车', $content, $user->id);
$this->message("申请已提交,请您等待我们的联系", $response);
return false;
}/*}}}*/
示例3: addNewBlackPhoneNum
/**
* addNewBlackPhoneNum
* @brief 操作:对新增黑名单号码的添加
* @author kxy
* @version tags/v3.0
* @date 2013-12-11
*/
public function addNewBlackPhoneNum($request, $response)
{
/*{{{*/
$request->convertToGbk();
$blackPhoneNum = $request->blackPhoneNum;
$addReason = $request->addReason;
if (false == XString::isValidPhoneNumber($blackPhoneNum)) {
throw new TelConfException("此号码是无效号码,请重新添加! <a href='blacklistmanage'>返回</a>");
}
if ($blackPhoneNum && $addReason) {
TeleConversationClient::getInstance()->createBlackList($blackPhoneNum, $addReason, $this->curOperator);
}
$response->setRedirect("/operator/blacklistmanage");
}