|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-11-26 10:32 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 15:00:02 2025 UTC |
Description: ------------ Trying to translate swedish encoded characters with strtr function using replace_pairs. The function translate numbers from 0 to sizeof(replace_pairs-array) to the string "Array". See example to reproduce. Reproduce code: --------------- <?php $strSearchWord = "abc123åpoli987654321"; $arrTransformChars[] = array('Å' => '?'); $arrTransformChars[] = array('Ä' => '?'); $arrTransformChars[] = array('Ö' => '?'); $arrTransformChars[] = array('å' => '?'); $arrTransformChars[] = array('ä' => '?'); $arrTransformChars[] = array('ö' => '?'); echo $strSearchWord . "<br>"; $strSearchWord = strtr($strSearchWord,$arrTransformChars); echo $strSearchWord . "<br>"; exit; ?> Expected result: ---------------- abc123åpoli987654321 abc123?poli987654321 Actual result: -------------- abc123?poli987654321 abcArrayArrayArray?poli9876ArrayArrayArrayArrayArray