php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12050 strtr strange results
Submitted: 2001-07-11 09:38 UTC Modified: 2001-07-11 13:54 UTC
From: -vit- at mail dot ru Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.0.6 OS: Win2K, WinNT 4
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:
28 + 27 = ?
Subscribe to this entry?

 
 [2001-07-11 09:38 UTC] -vit- at mail dot ru
Hi!

with 2 parameters all work fine.

With 3 parameters function return:

Example1:

strtr("Function resut is BAD", "BAD", "all right")
Result: 'Function resut is all'

Example2:

strtr("Function resut is BAD", "BAD", "ok")
Result: 'Function resut is okD'

Example3:

strtr("Function resut is BAD", "BAD", "")
Result: 'Function resut is BAD'


Thx 4 attention

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-11 09:40 UTC] derick@php.net
This is normal behavior, see www.php.net/strtr for more information.

Derick
 [2001-07-11 13:54 UTC] jeroen@php.net
You're looking for str_replace, strtr is something really different.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 14:01:29 2024 UTC