現在の位置: ホーム> 関数カテゴリ一覧> str_split

str_split

文字列を配列に変換します
名前:str_split
カテゴリ:
対応言語:php
一言説明:文字列を配列に分割します。

例2

文字列「上海」を配列に分割します。

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token function">print_r</span> <span class="token punctuation">(</span> <span class="token function">str_split</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"shanghai"</span> <span class="token punctuation">)</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

自分で試してみてください

例2

長さのパラメーターを使用します:

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token function">print_r</span> <span class="token punctuation">(</span> <span class="token function">str_split</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"shanghai"</span> <span class="token punctuation">、</span> <span class="token number">3</span> <span class="token punctuation">)</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

自分で試してみてください

類似の関数
  • 通貨文字列へのフォーマット番号 money_format

    money_format

    通貨文字列へのフォーマット番号
  • 反参照addcslashes()を使用して逃げた文字列 stripcslashes

    stripcslashes

    反参照addcslashes()を使用し
  • メタカラクターセットを脱出します quotemeta

    quotemeta

    メタカラクターセットを脱出します
  • バイナリセーフケース非感受性の文字列比較 strcasecmp

    strcasecmp

    バイナリセーフケース非感受性の文字列比較
  • 文字列を逆にします strrev

    strrev

    文字列を逆にします
  • フォーマットされた文字列を作成してストリーミングします vfprintf

    vfprintf

    フォーマットされた文字列を作成してストリ
  • ロケール設定に基づく文字列の比較 strcoll

    strcoll

    ロケール設定に基づく文字列の比較
  • 文字列の最初のバイトを0〜255の間の値に変換します ord

    ord

    文字列の最初のバイトを0〜255の間の値
人気記事(にんききじ)