strlen函數用于獲取字符串的長度。它的語法是:
strlen(string $string): int
其中,$string是要獲取長度的字符串,返回值是一個整數,表示字符串的長度。
例子:
在上述例子中,字符串"Hello World!"的長度是12個字符,所以輸出結果是12。