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

strlen

文字列の長さを取得します
名前:strlen
カテゴリ:
対応言語:php
一言説明:文字列の長さを返します。

例1

関数は、文字列「上海」の長さを返します。

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">Echo</span> <span class="token function">Strlen</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 delimiter important">?></span></span>

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

例2

文字列の長さを返します。「私は上海!」:

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">Echo</span> <span class="token function">Strlen</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 delimiter important">?></span></span>

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

類似の関数
  • 文字列の最初の出現を見つけます strstr

    strstr

    文字列の最初の出現を見つけます
  • ロケール情報の設定 setlocale

    setlocale

    ロケール情報の設定
  • フォーマットされた文字列を返します vsprintf

    vsprintf

    フォーマットされた文字列を返します
  • 1つ以上の文字列を出力します echo

    echo

    1つ以上の文字列を出力します
  • 文字列の最初の文字を小文字に設定します lcfirst

    lcfirst

    文字列の最初の文字を小文字に設定します
  • サブストリングの交換 str_replace

    str_replace

    サブストリングの交換
  • 文字列の一部を返します substr

    substr

    文字列の一部を返します
  • 文字を翻訳するか、サブストリングを交換します - 指定された文字を変換します strtr

    strtr

    文字を翻訳するか、サブストリングを交換し
人気記事(にんききじ)