note 71087 added to function.str-replace

From: Date: Sat, 11 Nov 2006 11:14:17 +0000
Subject: note 71087 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-119605@lists.php.net to get a copy of this message
This simple function may be usefull to convert czech text from cp-1250 encoding to iso-8859-2 (convert S, T and Z with caron). I use it because mbstring does not support windows-1250 (i.e. mb_convert_encoding(win2iso($text), "utf-8", "iso-8859-2");). <?php function win2iso($text) { $win = array ("\x9A", "\x9D", "\x9E", "\x8A", "\x8D", "\x8E"); $iso = array ("\xB9", "\xBB", "\xBE", "\xA9", "\xAB", "\xAE"); return str_replace($win, $iso, $text); } ?> ---- Server IP: 147.32.160.17 Probable Submitter: 81.31.45.161 ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- https://master.php.net/note/edit/71087 Del: integrated -- https://master.php.net/note/delete/71087/integrated Del: useless -- https://master.php.net/note/delete/71087/useless Del: bad code -- https://master.php.net/note/delete/71087/bad+code Del: spam -- https://master.php.net/note/delete/71087/spam Del: non-english -- https://master.php.net/note/delete/71087/non-english Del: in docs -- https://master.php.net/note/delete/71087/in+docs Del: other reasons-- https://master.php.net/note/delete/71087 Reject -- https://master.php.net/note/reject/71087 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#119605) next »