Re: [請益] 如何讓表單填入的數字是integer?
※ 引述《ThiefFan (不務正業的賊)》之銘言:
: 有一表單可以輸入$linamount
: <input type="text" name="linamount">
: 想限制這個欄位只能輸入整數所以加了檢查函式
: if(! is_int($linamount) ){
http://tw.php.net/manual/en/function.is-int.php
其實 document 有強調,中間 note 那一段:
Note: To test if a variable is a number or a numeric string (such as form
input, which is always a string), you must use is_numeric().
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.166.140.100
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章