PHP is_numeric or preg_match 0-9 validation

前端 未结 11 1570
别跟我提以往
别跟我提以往 2020-12-13 02:48

This isn\'t a big issue for me (as far as I\'m aware), it\'s more of something that\'s interested me. But what is the main difference, if any, of using is_numeric

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 03:02

    Meanwhile, all the values above will only restrict the values to integer, so i use

    /^[1-9][0-9\.]{0,15}$/
    

    to allow float values too.

提交回复
热议问题