note 94946 added to function.iconv

From: Date: Thu, 03 Dec 2009 21:48:07 +0000
Subject: note 94946 added to function.iconv
Groups: php.notes 
Request: Send a blank email to php-notes+get-163554@lists.php.net to get a copy of this message
I had a situation where I needed some characters transliterated, but the others ignored (for weird diacritics like ayn or hamza). Adding //TRANSLIT//IGNORE seemed to do the trick for me. It transliterates everything that is able to be transliterated, but then throws out stuff that can't be. So: <?php $string = "ʿABBĀSĀBĀD"; echo iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $string); // output: [nothing, and you get a notice] echo iconv('UTF-8', 'ISO-8859-1//IGNORE', $string); // output: ABBSBD echo iconv('UTF-8', 'ISO-8859-1//TRANSLIT//IGNORE', $string); // output: ABBASABAD // Yay! That's what I wanted! ?> ---- Server IP: 69.147.83.197 Probable Submitter: 66.115.219.210 ---- Manual Page -- http://www.php.net/manual/en/function.iconv.php Edit -- https://master.php.net/note/edit/94946 Del: integrated -- https://master.php.net/note/delete/94946/integrated Del: useless -- https://master.php.net/note/delete/94946/useless Del: bad code -- https://master.php.net/note/delete/94946/bad+code Del: spam -- https://master.php.net/note/delete/94946/spam Del: non-english -- https://master.php.net/note/delete/94946/non-english Del: in docs -- https://master.php.net/note/delete/94946/in+docs Del: other reasons-- https://master.php.net/note/delete/94946 Reject -- https://master.php.net/note/reject/94946 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#163554) next »