note 77316 deleted from function.trim by hholzgra

From: Date: Thu, 02 Aug 2012 12:26:14 +0000
Subject: note 77316 deleted from function.trim by hholzgra
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-189655@lists.php.net to get a copy of this message
Note Submitter: hkb at hkb dot it ---- 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; } ?>

« previous php.notes (#189655) next »