Laravel验证:数字和整数之间的区别? [英] Laravel validation : difference between numeric and integer?

查看:358
本文介绍了Laravel验证:数字和整数之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

laravel文档中,似乎有一个数字验证规则.我想知道两者之间的区别是什么?

in laravel docs there seems to be an integer and a numeric validation rule. i was wondering what the difference between the both was?

推荐答案

整数就像一个没有小数的整数:2, 256, 2048.

Integer is like a whole number without fraction: 2, 256, 2048.

http://php.net/manual/en/function.is- int.php

数字是包括浮点数在内的任何数字:2.478, +0123.45e6

Numeric is any number including floating point numbers: 2.478, +0123.45e6

http://php.net/manual/en/function.is- numeric.php

这篇关于Laravel验证:数字和整数之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆