开发者

Trimming array values

开发者 https://www.devze.com 2023-03-31 03:44 出处:网络
I know var_dump($array) trims the array content & print it开发者_JAVA技巧. but I want to skip the print part. What should I do? Should I use some other functionUse array_map with trim

I know var_dump($array) trims the array content & print it开发者_JAVA技巧. but I want to skip the print part. What should I do? Should I use some other function


Use array_map with trim

$trimmed = array_map('trim', $array);


You might find something here: http://php.net/manual/en/function.trim.php

0

精彩评论

暂无评论...
验证码 换一张
取 消