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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: -vit- at mail dot ru
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu May 08 00:01:29 2025 UTC