可以使用PHP內置函數strlen()來獲取字符串的長度,例如:```php$str = "Hello World";$length = strlen($str);echo $length; // 輸出 11```