我在php中使用以下代码:代码:
$input = array(" text1","text2 "," text3 "," text4");
$output = array();
foreach($input as $val)
{
$output[] = trim($val);
}
var_dump($output);
Run Code Online (Sandbox Code Playgroud)
是否可以在没有foreach循环的情况下修剪数组元素值?