$s = "あいう";
echo mb_strpos($s, "い");
なぜかこれで「2」と表示されてしまいました。解決するには文字コードを指定すれば良いとのこと(じゃあわざわざmbつける意味ってあるんですか?)。
$s = "あいう";
echo mb_strpos($s, "い", 0, "UTF-8");
1・文字列内を検索
2・指定した文字が最初に出る場所
3・検索開始する場所
4・文字コード
Go to list of users who liked
More than 5 years have passed since last update.
$s = "あいう";
echo mb_strpos($s, "い");
なぜかこれで「2」と表示されてしまいました。解決するには文字コードを指定すれば良いとのこと(じゃあわざわざmbつける意味ってあるんですか?)。
$s = "あいう";
echo mb_strpos($s, "い", 0, "UTF-8");
1・文字列内を検索
2・指定した文字が最初に出る場所
3・検索開始する場所
4・文字コード
Register as a new user and use Qiita more conveniently
Go to list of users who liked