note 19349 deleted from function.trim by didou

From: Date: Sun, 18 May 2003 02:35:44 +0000
Subject: note 19349 deleted from function.trim by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-48339@lists.php.net to get a copy of this message
Note Submitter: ednark@wm.edu ---- if you have an array of strings you want to trim, as in the previous example. It seems the way php intends you to do so is with the "array_map" function. http://www.php.net/manual/en/function.array-map.php $a = array("1", " 3 ", " 555 "); $b = array_map("trim", $a); print_r($a); print_r($b); Array ( [0] => 1 [1] => 3 [2] => 555 ) Array ( [0] => 1 [1] => 3 [2] => 555 )

« previous php.notes (#48339) next »