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

From: Date: Wed, 22 Jan 2003 20:47:15 +0000
Subject: #21818 [Opn->Bgs]: strange result with strtr()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-30949@lists.php.net to get a copy of this message
ID: 21818 Updated by: iliaa@php.net Reported By: ldbglobe@hotmail.com -Status: Open +Status: Bogus Bug Type: Strings related Operating System: Mandrake 8 PHP Version: 4.2.3 New Comment: 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 \#. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#30949) next »