note 62072 added to function.trim

From: Date: Sat, 18 Feb 2006 21:03:49 +0000
Subject: note 62072 added to function.trim
Groups: php.notes 
Request: Send a blank email to php-notes+get-103998@lists.php.net to get a copy of this message
I was accepting text pasted from a csv file into a textarea in my code. I found that even using trim was not able to get rid of the whitespace characters at the end of the string. Finally, using this helped: $result = trim($source,"\x7f..\xff\x0..\x1f"); Hope this saves someone few hours. All thanks to previous comment from HW for this ---- Server IP: 64.71.164.2 Probable Submitter: 68.205.54.39 ---- Manual Page -- http://www.php.net/manual/en/function.trim.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+62072 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62072&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62072&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62072&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62072&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62072&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62072&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62072&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+62072&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103998) next »