[ソースコード]
UTF-8 related string functions.
utf8.php に定義があります。
◆ utf8_bad_replace()
utf8_bad_replace |
( |
|
$string, |
|
|
|
$replace = '?' |
|
) |
| |
Replace bad bytes with an alternative character - ASCII character recommended is replacement char.
PCRE Pattern to locate bad bytes in a UTF-8 string Comes from W3 FAQ: Multilingual Forms.
Note: modified to include full ASCII range including control chars
- 引数
-
string | $string | A string to search. |
string | $replace | A string to replace bad bytes with - use ASCII. |
- 戻り値
- string
- 参照
- http://www.w3.org/International/questions/qa-forms-utf-8
utf8.php の 167 行目に定義があります。
◆ utf8_is_valid()
Tests a string as to whether it's valid UTF-8 and supported by the Unicode standard.
- 引数
-
string | $string | A UTF-8 encoded string. |
- 戻り値
- boolean
utf8.php の 139 行目に定義があります。
◆ utf8_stripos()
utf8_stripos |
( |
|
$haystack, |
|
|
|
$needle, |
|
|
|
$offset = 0 |
|
) |
| |
Finds position of first occurrence of a string within another, case insensitive. Returns false if needle is not found.
- 引数
-
string | $haystack | A haystack. |
string | $needle | A needle. |
int | $offset | An offset in Unicode code points. |
- 戻り値
- int
utf8.php の 106 行目に定義があります。
◆ utf8_strlen()
Returns the number of Unicode code points in a string.
Note: this function does not count bad bytes in the string - these are simply ignored.
- 引数
-
string | $string | A UTF-8 encoded string. |
- 戻り値
- int
utf8.php の 28 行目に定義があります。
◆ utf8_strpos()
utf8_strpos |
( |
|
$haystack, |
|
|
|
$needle, |
|
|
|
$offset = 0 |
|
) |
| |
Finds position of first occurrence of a string within another, case sensitive. Returns false if needle is not found.
- 引数
-
string | $haystack | A haystack. |
string | $needle | A needle. |
int | $offset | An offset in Unicode code points. |
- 戻り値
- int
utf8.php の 91 行目に定義があります。
◆ utf8_strtolower()
utf8_strtolower |
( |
|
$string | ) |
|
Makes a string lowercase.
Note: The concept of a characters "case" only exists is some alphabets such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does not exist in the Chinese alphabet, for example. See Unicode Standard Annex #21: Case Mappings.
- 引数
-
string | $string | A UTF-8 encoded string. |
- 戻り値
- string
utf8.php の 59 行目に定義があります。
◆ utf8_strtoupper()
utf8_strtoupper |
( |
|
$string | ) |
|
Makes a string uppercase.
Note: The concept of a characters "case" only exists is some alphabets such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does not exist in the Chinese alphabet, for example. See Unicode Standard Annex #21: Case Mappings.
- 引数
-
string | $string | A UTF-8 encoded string. |
- 戻り値
- string
utf8.php の 76 行目に定義があります。
◆ utf8_substr()
utf8_substr |
( |
|
$string, |
|
|
|
$offset, |
|
|
|
$length = null |
|
) |
| |
Returns part of a string given character offset and optionally length.
- 引数
-
string | $string | A UTF-8 encoded string. |
int | $offset | A number of UTF-8 code points offset. |
int | $length | A length in UTF-8 code points from offset |
- 戻り値
- string
utf8.php の 42 行目に定義があります。
◆ utf8_ucfirst()
Makes a string's first character uppercase.
- 引数
-
string | $string | A UTF-8 encoded string. |
- 戻り値
- string
utf8.php の 118 行目に定義があります。