note 56531 deleted from function.htmlentities by nlopess

From: Date: Tue, 06 Sep 2005 14:48:39 +0000
Subject: note 56531 deleted from function.htmlentities by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-94814@lists.php.net to get a copy of this message
Note Submitter: jamal dot soueidan at gmail dot com ---- I had to use this to search in the MySQL database for the right arabic word. This code convert all the &#1571; etc. to arabic letters so its easier to search for words in MySQL (tables). I think PHP.NET changed the arabic letters to some unknown now ? <?php # By: Jamal Soueidan # Date: 09/06/2005 # URL: http://www.arabfilms.org function convertToArabic($text) { $text = str_replace("&#1571;", "Ã", $text); $text = str_replace("&#1572;", "Ä", $text); $text = str_replace("&#1573;", "Å", $text); $text = str_replace("&#1574;", "Æ", $text); $text = str_replace("&#1575;", "Ç", $text); $text = str_replace("&#1576;", "È", $text); $text = str_replace("&#1577;", "É", $text); $text = str_replace("&#1578;", "Ê", $text); $text = str_replace("&#1579;", "Ë", $text); $text = str_replace("&#1580;", "Ì", $text); $text = str_replace("&#1581;", "Í", $text); $text = str_replace("&#1582;", "Î", $text); $text = str_replace("&#1583;", "Ï", $text); $text = str_replace("&#1584;", "Ð", $text); $text = str_replace("&#1585;", "Ñ", $text); $text = str_replace("&#1586;", "Ò", $text); $text = str_replace("&#1587;", "Ó", $text); $text = str_replace("&#1588;", "Ô", $text); $text = str_replace("&#1589;", "Õ", $text); $text = str_replace("&#1590;", "Ö", $text); $text = str_replace("&#1591;", "Ø", $text); $text = str_replace("&#1592;", "Ù", $text); $text = str_replace("&#1593;", "Ú", $text); $text = str_replace("&#1594;", "Û", $text); # 1595-1599 is just empty $text = str_replace("&#1600;", "Ü", $text); $text = str_replace("&#1601;", "Ý", $text); $text = str_replace("&#1602;", "Þ", $text); $text = str_replace("&#1603;", "ß", $text); $text = str_replace("&#1604;", "á", $text); $text = str_replace("&#1605;", "ã", $text); $text = str_replace("&#1606;", "ä", $text); $text = str_replace("&#1607;", "å", $text); $text = str_replace("&#1608;", "æ", $text); $text = str_replace("&#1609;", "ì", $text); $text = str_replace("&#1610;", "í", $text); $text = str_replace("&#1611;", "ð ", $text); $text = str_replace("&#1612;", "ñ ", $text); $text = str_replace("&#1613;", "ò ", $text); $text = str_replace("&#1614;", "ó", $text); $text = str_replace("&#1615;", "õ", $text); $text = str_replace("&#1616;", "ö", $text); $text = str_replace("&quot;", "", $text); $text = str_replace("'", "", $text); return $text; } ?>

« previous php.notes (#94814) next »