|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60291 Ltrim and Rtrim string contain number bug
Submitted: 2011-11-14 07:57 UTC Modified: 2011-11-14 08:28 UTC
From: ekoisa at gmail dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.3.8 OS: Linux
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.
Bug Type:
From: ekoisa at gmail dot com
New email:
PHP Version: OS:


 [2011-11-14 07:57 UTC] ekoisa at gmail dot com
strip string result for string contain numeric value not true;

this below code show it.

Test script:
echo "<br/>test ltrim: 05039 <br/>";
echo ltrim("05039", "05");

echo "<br/>test rtrim: 345030 <br/>";
echo rtrim("345030", "30");

Expected result:
test ltrim: 05039 

test rtrim: 345030

Actual result:
test ltrim: 05039 

test rtrim: 345030


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-14 08:28 UTC]
-Status: Open +Status: Bogus
 [2011-11-14 08:28 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

the sencode of the ?trim is a list. not a pattern.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Dec 03 21:01:23 2020 UTC