note 77131 added to function.trim

From: Date: Thu, 16 Aug 2007 12:26:01 +0000
Subject: note 77131 added to function.trim
Groups: php.notes 
Request: Send a blank email to php-notes+get-129529@lists.php.net to get a copy of this message
masteremployment's solution in a function, and with preg_replace() instead of ereg_replace(): <?php function removeWhitespace($string) { if (!is_string($string)) return false; $string = preg_quote($string, '|'); return preg_replace('| +|', ' ', $string); } ?> ---- Server IP: 217.13.201.10 Probable Submitter: 87.78.89.229 ---- Manual Page -- http://www.php.net/manual/en/function.trim.php Edit -- https://master.php.net/note/edit/77131 Del: integrated -- https://master.php.net/note/delete/77131/integrated Del: useless -- https://master.php.net/note/delete/77131/useless Del: bad code -- https://master.php.net/note/delete/77131/bad+code Del: spam -- https://master.php.net/note/delete/77131/spam Del: non-english -- https://master.php.net/note/delete/77131/non-english Del: in docs -- https://master.php.net/note/delete/77131/in+docs Del: other reasons-- https://master.php.net/note/delete/77131 Reject -- https://master.php.net/note/reject/77131 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129529) next »