文字列のバイト数をカウントする

strlen関数を使い、文字列のバイト数を取得することができます。

<?php

$str = "hello word!!";
echo strlen($str);// 12 と出力されます。

?>

 

[対象]
PHP 5.x