<?php
// 定义一个字符串
$string = "###Hello, World!###";
// 使用 trim() 函数去除字符串首尾的指定字符
// 这里的参数 "#" 表示要去除的字符
$trimmed_string = trim($string, "#");
// 输出结果
echo $trimmed_string; // 输出: Hello, World!
?>
trim() 函数用于去除字符串首尾的指定字符。"#"。上一篇:php 转int
下一篇:php 字符串转小写
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站