note 58501 added to function.convert-cyr-string

From: Date: Sun, 06 Nov 2005 14:56:02 +0000
Subject: note 58501 added to function.convert-cyr-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-98160@lists.php.net to get a copy of this message
// Modificated by tapin13 // Corrected by Timuretis // Convert win-1251 to utf-8 function unicode_russian($str) { $encode = ""; // 1025 = "&#1025;"; // 1105 = "&#1105;"; for ($ii=0;$ii<strlen($str);$ii++) { $xchr=substr($str,$ii,1); if (ord($xchr)>191) { $xchr=ord($xchr)+848; $xchr="&#" . $xchr . ";"; } if(ord($xchr) == 168) { // $xchr = "&#1025"; $xchr = "&#1025;"; //!!!!!!!!!!!!!!!!!!!!!!! } if(ord($xchr) == 184) { // $xchr = "&#1105"; $xchr = "&#1105;"; //!!!!!!!!!!!!!!!!!!!!!! } $encode=$encode . $xchr; } return $encode; } ---- Manual Page -- http://www.php.net/manual/en/function.convert-cyr-string.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58501 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58501&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58501&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58501&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58501&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58501&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58501&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58501&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58501&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#98160) next »