本文整理匯總了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");
}