[Php 4, Php 5, Php 7, Php 8]
strtouper - tạo một chuỗi chữ hoa — Make a string uppercase
Sự mô tả
Strtouper [Chuỗi $string
]: Chuỗi[string $string
]: string
Các byte trong phạm vi "a"
[0x61] thành "z"
[0x7a] sẽ được chuyển đổi thành chữ cái chữ hoa tương ứng bằng cách trừ 32 từ mỗi giá trị byte.
Điều này có thể được sử dụng để chuyển đổi các ký tự ASCII trong các chuỗi được mã hóa bằng UTF-8, vì các ký tự UTF-8 Multibyte sẽ bị bỏ qua. Để chuyển đổi các ký tự không phải là ASCII, hãy sử dụng mb_strtoupper [].mb_strtoupper[].
Thông số
string
Chuỗi đầu vào.
Trả về giá trị
Trả về chuỗi bán dẫn.
Thay đổi
8.2.0 | Strtouper [Chuỗi $string ]: Chuỗisetlocale[]. Only ASCII characters will be converted.
|
Các byte trong phạm vi "a"
[0x61] thành "z"
[0x7a] sẽ được chuyển đổi thành chữ cái chữ hoa tương ứng bằng cách trừ 32 từ mỗi giá trị byte.
Điều này có thể được sử dụng để chuyển đổi các ký tự ASCII trong các chuỗi được mã hóa bằng UTF-8, vì các ký tự UTF-8 Multibyte sẽ bị bỏ qua. Để chuyển đổi các ký tự không phải là ASCII, hãy sử dụng mb_strtoupper [].strtoupper[] example
Thông số
string
: This function is binary-safe.
Chuỗi đầu vào.
- Trả về giá trị
- Trả về chuỗi bán dẫn.
- Thay đổi
- Phiên bản
Chuyển đổi trường hợp không còn phụ thuộc vào tập hợp địa phương với setlocale []. Chỉ các ký tự ASCII sẽ được chuyển đổi. ¶
Ví dụ
One might think that setting the correct locale would do the trick with for example german umlauts, but this is not the case. You have to use mb_strtoupper[] instead:
Ví dụ #1 Strtouper [] Ví dụ ¶
Ghi chú
Here is how to make the character in upper case, except HTML-entities:
"a"
0
"a"
1
"a"
2Lưu ý: Hàm này an toàn cho nhị phân. ¶
Xem thêm
"a"
3
strtolower [] - tạo chữ thường chuỗi ¶
ucfirst [] - Tạo nhân vật chữ hoa đầu tiên của chuỗi
"a"
4
"a"
5
"a"
2ucwords [] - chữ hoa, ký tự đầu tiên của mỗi từ trong một chuỗi ¶
mb_strtoupper [] - tạo một chuỗi chữ hoa
"a"
7
"a"
8
9 năm trước ¶
uilmind tại fv.com.ua ¶
"z"
0
"z"
1
"z"
2
"z"
3
"z"
4
0
1
"a"
219 năm trước ¶
mb_strtoupper [] - tạo một chuỗi chữ hoa
3
4
"a"
2Andre tại Koethur Dot de ¶ ¶
9 năm trước
6
7
8
9
One might think that setting the correct locale would do the trick with for example german umlauts, but this is not the case. You have to use mb_strtoupper[] instead:
0uilmind tại fv.com.ua ¶ ¶
6 năm trước
One might think that setting the correct locale would do the trick with for example german umlauts, but this is not the case. You have to use mb_strtoupper[] instead:
1
One might think that setting the correct locale would do the trick with for example german umlauts, but this is not the case. You have to use mb_strtoupper[] instead:
2
One might think that setting the correct locale would do the trick with for example german umlauts, but this is not the case. You have to use mb_strtoupper[] instead:
3
One might think that setting the correct locale would do the trick with for example german umlauts, but this is not the case. You have to use mb_strtoupper[] instead:
4
One might think that setting the correct locale would do the trick with for example german umlauts, but this is not the case. You have to use mb_strtoupper[] instead:
5
One might think that setting the correct locale would do the trick with for example german umlauts, but this is not the case. You have to use mb_strtoupper[] instead:
6
"a"
2MEC tại Stadeleck Dot org ¶ ¶
19 năm trước
One might think that setting the correct locale would do the trick with for example german umlauts, but this is not the case. You have to use mb_strtoupper[] instead:
8
One might think that setting the correct locale would do the trick with for example german umlauts, but this is not the case. You have to use mb_strtoupper[] instead:
9