Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php array remove empty values recursive

array_filter(explode('/', '/home/teste sdsd/   /'), 'trim');
//Result
[
     1 => "home",
     2 => "teste sdsd",
]

//-----------
array_filter(explode('/', '/home/teste sdsd/   /'), 'strlen')
//Result
  [
     1 => "home",
     2 => "teste sdsd",
     3 => "   ",
   ]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #array #remove #empty #values #recursive
ADD COMMENT
Topic
Name
2+2 =