今回は、PHP で mb_strposを使用する手順について詳しく説明します。PHP で mb_strpos を使用する際の注意事項 は何ですか?実際の事例を見てみましょう。
mb_strpos(PHP 4 >= 4.0.6, PHP 5, PHP 7)説明mb_strpos — 文字列内で最初に出現する文字列の
位置を検索しますmb_strpos — 別の文字列内で最初に出現する
stringを検索します
int mb_strpos ( string $haystack , string $needle [, int $offset = 0 [, string $encoding = mb_internal_encoding() ]] ) //Finds position of the first occurrence of a string in a string. // 查找 string 在一个 string 中首次出现的位置。 //Performs a multi-byte safe strpos() operation based on number of characters. The first character's position is 0, the second character position is 1, and so on. // 基于字符数执行一个多字节安全的 strpos() 操作。 第一个字符的位置是 0,第二个字符的位置是 1,以此类推。
mb_strlen( $haystack, $encoding ) ) { 壊す; } } $haystack を返します。 } $replace = mb_str_replace( "hello world !hello world !hello world !hello world !", "hello", "hi" ); エコー $replace 。 PHP_EOL; //ハイワールド!ハイワールド!ハイワールド!ハイワールド! //こんにちは PHP!こんにちは PHP!こんにちは PHP!こんにちは PHP! echo mb_str_replace( $replace, "world", "PHP" ) 。 PHP_EOL; echo mb_str_replace( $replace, " ", "-" ) 。 PHP_EOL; //PHP は世界最高の言葉です
以上がPHPでmb_strposを使用する手順の詳細な説明の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。