php对字符串去头去尾,已知要去掉头部几位,尾部几位
$str = "Hello, world!"; $length = strlen($str); $trimmedStr = substr($str, 1, $length - 2); // 输出=>ello, world