Re: Trimming Array value

From: Date: Wed, 20 Jun 2001 22:06:10 +0000
Subject: Re: Trimming Array value
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-54624@lists.php.net to get a copy of this message
something like this: <? function recursive_rtrim($ar) { foreach($ar as $key => $val) $ar[$key] = is_array($val) ? recursive_rtrim($val) : rtrim($val); return $ar; } ?> lenar. ""Reuben D Budiardja"" <reubendb@goshen.edu> wrote in message news:01062016562904.10962@devcorps2.goshen.edu... I have a multi-dimensional array. I want to trim every values so that none of them have trailing space. What is the most efficient way to do that ? I don't necessaryly know the dimension of the array ahead of time, so the function need to be able to handle it recursively. Thanks Reuben D. Budiardja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#54624) next »