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
 [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-2022 The PHP Group
All rights reserved.
Last updated: Fri Oct 07 12:03:43 2022 UTC