public function exact_length($str, $val) { if (!is_numeric($val)) { return FALSE; } return mb_strlen($str) === (int) $val; }