note 75744 added to function.trim

From: Date: Thu, 14 Jun 2007 02:43:58 +0000
Subject: note 75744 added to function.trim
Groups: php.notes 
Request: Send a blank email to php-notes+get-127465@lists.php.net to get a copy of this message
I needed to trim whitespace on the left, on the right, in the middle, everywhere. Here's a function to do it. The first parameter ($hayStack) will have all the characters found in the second parameter ($whiteSpaceChars) removed from it. function trimlrm ($hayStack, $whiteSpaceChars) { $trimmmed = ""; for ($i = 0; $i < strlen($hayStack); $i++) { if (strpos($whiteSpaceChars,$hayStack[$i]) === false) $trimmed .= $hayStack[$i]; } return $trimmed; } ---- Server IP: 64.71.164.2 Probable Submitter: 209.132.160.202 ---- Manual Page -- http://www.php.net/manual/en/function.trim.php Edit -- https://master.php.net/note/edit/75744 Del: integrated -- https://master.php.net/note/delete/75744/integrated Del: useless -- https://master.php.net/note/delete/75744/useless Del: bad code -- https://master.php.net/note/delete/75744/bad+code Del: spam -- https://master.php.net/note/delete/75744/spam Del: non-english -- https://master.php.net/note/delete/75744/non-english Del: in docs -- https://master.php.net/note/delete/75744/in+docs Del: other reasons-- https://master.php.net/note/delete/75744 Reject -- https://master.php.net/note/reject/75744 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#127465) next »