note 90171 added to function.trim

From: Date: Wed, 08 Apr 2009 20:35:38 +0000
Subject: note 90171 added to function.trim
Groups: php.notes 
Request: Send a blank email to php-notes+get-152976@lists.php.net to get a copy of this message
I made this function to trim texts. Removes al double horizontal and vertical whitespace chars. function trimText($str) { $str = trim($str); $str = preg_replace('/\h+/', ' ', $str); $str = preg_replace('/\v{3,}/', PHP_EOL.PHP_EOL, $str); return $str; } ---- Server IP: 91.199.167.18 Probable Submitter: 87.210.242.103 ---- Manual Page -- http://www.php.net/manual/en/function.trim.php Edit -- https://master.php.net/note/edit/90171 Del: integrated -- https://master.php.net/note/delete/90171/integrated Del: useless -- https://master.php.net/note/delete/90171/useless Del: bad code -- https://master.php.net/note/delete/90171/bad+code Del: spam -- https://master.php.net/note/delete/90171/spam Del: non-english -- https://master.php.net/note/delete/90171/non-english Del: in docs -- https://master.php.net/note/delete/90171/in+docs Del: other reasons-- https://master.php.net/note/delete/90171 Reject -- https://master.php.net/note/reject/90171 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#152976) next »