Re: [請益] 如何讓表單填入的數字是integer?

看板PHP作者 (肯先生)時間16年前 (2010/02/06 18:07), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《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
文章代碼(AID): #1BRJzizv (PHP)
文章代碼(AID): #1BRJzizv (PHP)