request->post['telephone'])) { $this->error['telephone'] = $this->language->get('error_telephone'); } else{ $telephone_v = $this->model_account_customer-&g"/> request->post['telephone'])) { $this->error['telephone'] = $this->language->get('error_telephone'); } else{ $telephone_v = $this->model_account_customer-&g">

ホームページ  >  記事  >  バックエンド開発  >  php if判断出现的鬼怪问题

php if判断出现的鬼怪问题

WBOY
WBOYオリジナル
2016-06-02 11:28:301096ブラウズ

phpif判断

if ( !preg_match("/^1[34578]\d{9}$/",$this->request->post['telephone'])) {
$this->error['telephone'] = $this->language->get('error_telephone');
}
else{
$telephone_v = $this->model_account_customer-> getTelephoneValidation($this->request->post['telephone']);
if($telephone_v != 0) {

// $this->error['telephone'] = $this->language->get('error_telephone_v');
printf("得到的数据为:%d", $telephone_v);
$this->error['telephone'] = $this->language->get('error_telephone_v');
}

}
让人惊讶的是 $telephone_v =0 很能执行并打印了0,错误正常显示。

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。