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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 19 13:01:30 2024 UTC