php.net |  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 + 17 = ?
Subscribe to this entry?

 
 [2011-11-14 07:57 UTC] ekoisa at gmail dot com
Description:
------------
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 
039

test rtrim: 345030
3450

Actual result:
--------------
test ltrim: 05039 
39

test rtrim: 345030
345

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

the sencode of the ?trim is a list. not a pattern.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 08:01:23 2020 UTC