note 53908 deleted from function.trim by felipe

From: Date: Wed, 06 Aug 2008 22:07:54 +0000
Subject: note 53908 deleted from function.trim by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-143252@lists.php.net to get a copy of this message
Note Submitter: ervin dot kosch at gmail dot com ---- I find that when I use the explode() function to break apart string that read from a text file it sometime leave LF or CR that mess up my text processing. So I wrote this function to get rid of any white spaces or CF/LF that might be causing a problem. I have had some people report problems in older versions of PHP4. <? function utrim($source){ $temp = ltrim($source); $temp = rtrim($temp); $temp = trim($temp); return $temp; } ?>

« previous php.notes (#143252) next »