-1

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

infinityskyline
  • 369
  • 2
  • 4
  • 17

2 Answers2

6

Use array_map with trim

$trimmed = array_map('trim', $array);
adlawson
  • 6,303
  • 1
  • 35
  • 46
0

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

Ahsan
  • 459
  • 8
  • 22