note 77316 added to function.trim
| From: | hkb at hkb dot it | Date: | Fri, 24 Aug 2007 10:03:29 +0000 |
| Subject: | note 77316 added to function.trim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129745@lists.php.net to get a copy of this message | ||
I have made this simple function to trim the whole string instead of just the beginning and end...
<?php
function strTrimTotal($input) {
$input = trim($input);
for($i=0;$i<strlen($input);$i++) {
if(substr($input, $i, 1) != " ") {
$output .= trim(substr($input, $i, 1));
} else {
$output .= " ";
}
}
return $output;
}
?>
----
Server IP: 195.184.96.15
Probable Submitter: 83.91.147.99
----
Manual Page -- http://www.php.net/manual/en/function.trim.php
Edit -- https://master.php.net/note/edit/77316
Del: integrated -- https://master.php.net/note/delete/77316/integrated
Del: useless -- https://master.php.net/note/delete/77316/useless
Del: bad code -- https://master.php.net/note/delete/77316/bad+code
Del: spam -- https://master.php.net/note/delete/77316/spam
Del: non-english -- https://master.php.net/note/delete/77316/non-english
Del: in docs -- https://master.php.net/note/delete/77316/in+docs
Del: other reasons-- https://master.php.net/note/delete/77316
Reject -- https://master.php.net/note/reject/77316
Search -- https://master.php.net/manage/user-notes.php