absint

函式
absint ( $maybeint )
引數
  • (mixed) $maybeint Data you wish to have converted to a non-negative integer.
    Required:
返回值
  • (int) A non-negative integer.
定義位置
相關方法
get_transientkses_initset_transienthas_filterrandom_int
引入
2.5.0
棄用
-

absint:該函式用於將一個變數轉換為整數,確保結果總是一個正數。它通常用於淨化使用者輸入,防止SQL隱碼攻擊。

將一個值轉換為非負整數。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function absint( $maybeint ) {
return abs( (int) $maybeint );
}
function absint( $maybeint ) { return abs( (int) $maybeint ); }
function absint( $maybeint ) {
	return abs( (int) $maybeint );
}

常見問題

FAQs
檢視更多 >