PHP中没有length,可以用strlen()函数。如果需要用到编码问题,可以使用mb_strlen()函数,用法如下: int mb_strlen ( string $str [, string $encoding ] );