php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15828 Trim() leaving 1 begining/ending whitespace
Submitted: 2002-03-02 03:09 UTC Modified: 2002-03-02 13:31 UTC
From: shane dot hochstetler at attbi dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.1.1 OS: WindowsXP Pro
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: shane dot hochstetler at attbi dot com
New email:
PHP Version: OS:

 

 [2002-03-02 03:09 UTC] shane dot hochstetler at attbi dot com
This is using php4isapi.dll

$var = '   content   ';
trim($var);
echo "->".$var."<-";
echo "->$var<-";

Output:
 -> content <-
 -> content <-

leaves 1 whitespace at the beginning and at the end.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-02 05:27 UTC] sander@php.net
RTFM! trim() returns the trimmed string.
$foo = trim($foo) and not trim($foo)
 [2002-03-02 12:52 UTC] shane dot hcohstetler at attbi dot com
This is using php4isapi.dll

$var = '   content   ';
$var = trim($var);      // fixed TYPO..
echo "->".$var."<-";
echo "->$var<-";

Output:
 -> content <-
 -> content <-

leaves 1 whitespace at the beginning and at the end.


and I have RTFM!!!
 [2002-03-02 13:31 UTC] shane dot hochstetler at attbi dot com
Not sure what it was, but I restarted IIS 5.1 and now it works.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 11:01:27 2024 UTC