[ create a new paste ] login | about

Link: http://codepad.org/UaYxowql    [ raw code | output | fork ]

PHP, pasted on Apr 19:
1
2
3
4
5
6
7
<?php

$array = array('0', "This", " ", "is", " ", "a", " ", "test.");

$array = array_filter($array, 'trim');

var_dump($array);


Output:
1
2
3
4
5
6
7
8
9
10
array(4) {
  [1]=>
  string(4) "This"
  [3]=>
  string(2) "is"
  [5]=>
  string(1) "a"
  [7]=>
  string(5) "test."
}


Create a new paste based on this one


Comments: