note 104776 modified in function.utf8-encode by danbrown

From: Date: Wed, 06 Jul 2011 21:26:11 +0000
Subject: note 104776 modified in function.utf8-encode by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-181298@lists.php.net to get a copy of this message
Conversion for Croatian characters: <?php function croURLtoCHAR($text) { $url=array( "%C5%A0","%C5%A1", "%C4%90","%C4%91", "%C4%8C","%C4%8D", "%C4%86","%C4%87", "%C5%BD","%C5%BE" ); $char=array( "Š","š", "Đ","đ", "Č","č", "Ć","ć", "Ž","ž" ); return str_replace($url,$char,$text); } function croCHARtoURL($text) { $char=array( "Š","š", "Đ","đ", "Č","č", "Ć","ć", "Ž","ž" ); $url=array( "%C5%A0","%C5%A1", "%C4%90","%C4%91", "%C4%8C","%C4%8D", "%C4%86","%C4%87", "%C5%BD","%C5%BE" ); return str_replace($char,$url,$text); } ?> NOTE: Obviously, you'll have to use other functions to replace/encode/decode the rest of the characters/code. --was-- Conversion for Croatian characters: ___________ function croURLtoCHAR($text) { $url=array( "%C5%A0","%C5%A1", "%C4%90","%C4%91", "%C4%8C","%C4%8D", "%C4%86","%C4%87", "%C5%BD","%C5%BE" ); $char=array( "Š","š", "Đ","đ", "Č","č", "Ć","ć", "Ž","ž" ); return str_replace($url,$char,$text); } function croCHARtoURL($text) { $char=array( "Š","š", "Đ","đ", "Č","č", "Ć","ć", "Ž","ž" ); $url=array( "%C5%A0","%C5%A1", "%C4%90","%C4%91", "%C4%8C","%C4%8D", "%C4%86","%C4%87", "%C5%BD","%C5%BE" ); return str_replace($char,$url,$text); } ________________ NOTE: Obviously, you'll have to use other functions to replace/encode/decode the rest of the characters/code. http://php.net/manual/en/function.utf8-encode.php

« previous php.notes (#181298) next »