Forum und email

strlen

(PHP 4, PHP 5)

strlen — 文字列の長さを得る

説明

int strlen ( string $string )

与えられた string の長さを返します。

パラメータ

string

長さを調べる文字列。

返り値

成功した場合に string の長さ、 string が空の文字列だった場合に 0 を返します。

Example#1 strlen() の例

<?php
$str 
'abcdef';
echo 
strlen($str); // 6

$str ' ab cd ';
echo 
strlen($str); // 7
?>