note 53908 added to function.trim

From: Date: Thu, 16 Jun 2005 14:25:26 +0000
Subject: note 53908 added to function.trim
Groups: php.notes 
Request: Send a blank email to php-notes+get-90544@lists.php.net to get a copy of this message
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; } ?> ---- Manual Page -- http://www.php.net/manual/en/function.trim.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+53908 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53908&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53908&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53908&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53908&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+53908&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53908&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+53908&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#90544) next »