New line in PHP array -


doing print_r on array produces:

array (     [0] => dogs     [1] => cats      [2] => birds ) 

the newline between cats , birds causing problem. did following , spacing still persists: array_walk($arr,'trim');

what can done remove spacing?

array_walk returns boolean. use array_map instead:

$arr = array_map("trim", $arr); 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -