Skip to main content

eq

Function eq 

Source
pub fn eq(value: &Value, rule: &str, _data: &Value, _field: &str) -> bool
Expand description

验证是否等于某个值 — 对齐 PHP eq

对齐 PHP Validate.php 第 802-805 行

§PHP 行为

return $value == $rule;(松散比较)

  • 数字与数字字符串按数字比较(1 == "1" 为 true)
  • 其他按字符串比较