現在の位置: ホーム> 関数カテゴリ一覧> 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>

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

類似の関数
  • htmlspecialchars()およびhtmlentities()を使用した後、変換テーブルを返します get_html_translation_table

    get_html_translation_table

    htmlspecialchars()およ
  • ロケール情報の設定 setlocale

    setlocale

    ロケール情報の設定
  • 文字列の最初の文字を小文字に設定します lcfirst

    lcfirst

    文字列の最初の文字を小文字に設定します
  • 文字列を置き換えるサブストリング substr_replace

    substr_replace

    文字列を置き換えるサブストリング
  • 1つ以上の文字列を出力します echo

    echo

    1つ以上の文字列を出力します
  • 文字列の先頭にあるいくつかの文字のバイナリ安全な比較(ケースは鈍感) strncasecmp

    strncasecmp

    文字列の先頭にあるいくつかの文字のバイナ
  • 通貨文字列へのフォーマット番号 money_format

    money_format

    通貨文字列へのフォーマット番号
  • 特定のファイルのMD5ハッシュ値を計算します md5_file

    md5_file

    特定のファイルのMD5ハッシュ値を計算し
人気記事(にんききじ)