[Php 4, Php 5, Php 7, Php 8]
IS_INT - Tìm xem loại biến có số nguyên không — Find whether the type of a variable is integer
Sự mô tả
is_int [hỗn hợp $value
]: bool[mixed $value
]: bool
Ghi chú::
Để kiểm tra xem một biến là số hoặc chuỗi số [chẳng hạn như đầu vào biểu mẫu, luôn luôn là một chuỗi], bạn phải sử dụng is_numeric [].is_numeric[].
Thông số
value
Biến được đánh giá.
Trả về giá trị
Trả về true
nếu value
là INT, false
nếu không.true
if value
is an int, false
otherwise.
Ví dụ
Ví dụ #1 is_int [] ví dụis_int[] example
Ví dụ trên sẽ xuất ra:
is_int[23] = bool[true] is_int['23'] = bool[false] is_int[23.5] = bool[false] is_int['23.5'] = bool[false] is_int[NULL] = bool[false] is_int[true] = bool[false] is_int[false] = bool[false]
Xem thêm
- is_bool [] - Tìm hiểu xem một biến có phải là boolean
- is_float [] - Tìm liệu loại biến có nổi không
- is_numeric [] - Tìm một biến là số hay chuỗi số
- is_String [] - Tìm loại biến là chuỗi
- is_array [] - Tìm xem một biến có phải là một mảng không
- is_Object [] - Tìm xem một biến có phải là một đối tượng
Simon Neaves ¶ ¶
14 năm trước
I've found that both that is_int and ctype_digit don't behave quite as I'd expect, so I made a simple function called isInteger which does. I hope somebody finds it useful.
Robin ¶ ¶
12 năm trước
$value
0
$value
1
$value
2
$value
3
$value
4
E Dot Sand tại Elisand Dot Com ¶ ¶
13 năm trước
$value
6
$value
7
$value
8
Andre Dot Roesti ở 7Flex DOT NET ¶ ¶
12 năm trước
value
0
value
1
E Dot Sand tại Elisand Dot Com ¶ ¶
13 năm trước
value
3
value
4
value
5
Andre Dot Roesti ở 7Flex DOT NET ¶ ¶
Davide Dot Renzi tại Gmail Dot Com ¶
value
7
value
8
value
9
6 năm trước ¶
Davide Dot Renzi tại Gmail Dot Com ¶
true
1
true
2
6 năm trước ¶
13 năm trước
true
4
true
5
true
6
true
7Andre Dot Roesti ở 7Flex DOT NET ¶ ¶
Davide Dot Renzi tại Gmail Dot Com ¶
true
8
true
9
value
0
6 năm trước ¶
13 năm trước
value
2
value
3
value
4
value
5
Andre Dot Roesti ở 7Flex DOT NET ¶ ¶
Davide Dot Renzi tại Gmail Dot Com ¶
value
7
value
8
value
9
6 năm trước ¶
14 năm trước
false
1
false
2
false
3
false
4
false
5
¶
Robin ¶
false
7
12 năm trước ¶
E Dot Sand tại Elisand Dot Com ¶
false
8
false
9
13 năm trước ¶
14 năm trước
1
2
¶
Robin ¶
4
12 năm trước ¶
Davide Dot Renzi tại Gmail Dot Com ¶
5
6
7
8
9
I've found that both that is_int and ctype_digit don't behave quite as I'd expect, so I made a simple function called isInteger which does. I hope somebody finds it useful.
0
6 năm trước ¶
petepostma tại gmail dot spam dot com ¶
I've found that both that is_int and ctype_digit don't behave quite as I'd expect, so I made a simple function called isInteger which does. I hope somebody finds it useful.
2
I've found that both that is_int and ctype_digit don't behave quite as I'd expect, so I made a simple function called isInteger which does. I hope somebody finds it useful.
3
I've found that both that is_int and ctype_digit don't behave quite as I'd expect, so I made a simple function called isInteger which does. I hope somebody finds it useful.
4
I've found that both that is_int and ctype_digit don't behave quite as I'd expect, so I made a simple function called isInteger which does. I hope somebody finds it useful.
5
10 năm trước ¶
13 năm trước
I've found that both that is_int and ctype_digit don't behave quite as I'd expect, so I made a simple function called isInteger which does. I hope somebody finds it useful.
7
I've found that both that is_int and ctype_digit don't behave quite as I'd expect, so I made a simple function called isInteger which does. I hope somebody finds it useful.
8
I've found that both that is_int and ctype_digit don't behave quite as I'd expect, so I made a simple function called isInteger which does. I hope somebody finds it useful.
9Andre Dot Roesti ở 7Flex DOT NET ¶ ¶
14 năm trước
0
1
¶
Robin ¶
3
4
12 năm trước ¶
13 năm trước
6
7
8
Andre Dot Roesti ở 7Flex DOT NET ¶ ¶
Davide Dot Renzi tại Gmail Dot Com ¶
0
6 năm trước ¶
13 năm trước
1
2
Robin ¶ ¶
Robin ¶
4
12 năm trước ¶
12 năm trước
5
6
7
8E Dot Sand tại Elisand Dot Com ¶ ¶
petepostma tại gmail dot spam dot com ¶
9
$value
00
Robin ¶ ¶
petepostma tại gmail dot spam dot com ¶
$value
02
$value
03
$value
04