[ create a new paste ] login | about

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

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

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

$array = preg_grep('/^\s*\z/', $array, PREG_GREP_INVERT);

var_dump($array);


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


Create a new paste based on this one


Comments: