Bug #2459 Updated: trim converts single newline into null
| From: | Bug Database | Date: | Thu, 07 Oct 1999 13:17:30 +0000 |
| Subject: | Bug #2459 Updated: trim converts single newline into null | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-11604@lists.php.net to get a copy of this message | ||
ID: 2459
Updated by: andrei
Reported By: alderete@be.com
Status: Closed
Bug Type: Misbehaving function
Assigned To:
Comments:
trim() is behaving as expected. If a string containing only "\n"
is passed to it, the result is an empty string. You're confused
because you're trying to use sizeof() to get the size of the string.
Sizeof() is the same as count() so it returns 1 since the variable
has 1 value. You should be using strlen() to get the length of the
string.
Full Bug description available at: http://bugs.php.net/?id=2459