#40243 [Bgs]: Clarify that trim(),ltrim(),rtrim() will trim ANY character in charlist

From: Date: Sun, 04 Feb 2007 14:26:20 +0000
Subject: #40243 [Bgs]: Clarify that trim(),ltrim(),rtrim() will trim ANY character in charlist
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969375254@lists.php.net to get a copy of this message
ID: 40243 User updated by: burg1 at gmx dot net Reported By: burg1 at gmx dot net Status: Bogus Bug Type: Documentation problem PHP Version: Irrelevant New Comment: My first, and foremost, suggestion would be to add another usage example. The three present examples (for ltrim) all deal with whitespace removal. So please include one with character removal, e.g. the "deeds" example given. Additionally, my second suggestion is to replace the sentence "You can also specify the characters you want to strip, by means of the charlist parameter. Simply list all characters that you want to be stripped. With .. you can specify a range of characters." with "If the carlist parameter is present, each single character given is trimmed from the beginning of the string, repeatedly. With .. you can specify a range of characters." Previous Comments: ------------------------------------------------------------------------ [2007-02-04 13:44:38] bjori@php.net That is why the argument is called "charlist", not "wordlist". If you do however have a rephrase is mind, please share. ------------------------------------------------------------------------ [2007-01-26 01:07:48] burg1 at gmx dot net Description: ------------ Please clarify what the trim() functions actually do if the charlist argument is present: ltrim('deeds', 'ed'); returns: 's' EACH single character in charlist is trimmed from the beginning of the string, REPEATEDLY. Please include this (or something similar) as a usage example in the docs! There are already 2 false bug reports filed from people who obviously misunderstood how these functions work: http://bugs.php.net/bug.php?id=35584 http://bugs.php.net/bug.php?id=22217 To figure this out just gave me an hour-long headache ;-) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40243&edit=1

« previous php.doc (#969375254) next »