#21818 [Bgs]: strange result with strtr()

From: Date: Thu, 23 Jan 2003 11:43:26 +0000
Subject: #21818 [Bgs]: strange result with strtr()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-31054@lists.php.net to get a copy of this message
 ID:               21818
 User updated by:  ldbglobe@hotmail.com
 Reported By:      ldbglobe@hotmail.com
 Status:           Bogus
 Bug Type:         Strings related
 Operating System: Mandrake 8
 PHP Version:      4.2.3
 New Comment:

hu ho what a mistake
thank's


Previous Comments:
------------------------------------------------------------------------

[2003-01-22 14:47:14] iliaa@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

You are not specifying the array correctly.
it should be array('#' => '\#');

Otherwise it uses numeric keys for each array element 0 for # and 1 for
\#. Meaning that all 0s will be replaced with '#' and all 1s will be
replaced with \#.

------------------------------------------------------------------------

[2003-01-22 08:56:55] ldbglobe@hotmail.com

on freeBSD I observed the same issue

------------------------------------------------------------------------

[2003-01-22 08:53:49] ldbglobe@hotmail.com

when i execute this expression,

echo $val=strtr('1',array('"','\"'));

i obtain the following result :

\"

infact of 1

i try to make this operation with some other number but the problème
seems appear only with the string '1'

PS: sorry for my poor english

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21818&edit=1



Thread (4 messages)

« previous php.bugs (#31054) next »