源代码:
<HTML> <HEAD></HEAD> <FONT FACE="'Courier New',Verdana, Arial, Helvetica" SIZE=2> <!DOCTYPE html> <html> <body> <FONT COLOR=#ff0000><?php $str = "Hello world! u00e6u00f8u00e5"; echo $str . " "; echo convert_cyr_string($str,'w','a'); ?></FONT> <p>In this example we convert a string from the character-set "w" (windows-1251) to "a" (x-cp866).</p> </body> </html> </HTML>
运行结果:
<HTML> <HEAD></HEAD> <FONT FACE="'Courier New',Verdana, Arial, Helvetica" SIZE=2> <!DOCTYPE html> <html> <body> <FONT COLOR=#ff0000>Hello world! u00e6u00f8u00e5 Hello world! u00e6u00f8u00e5</FONT> <p>In this example we convert a string from the character-set "w" (windows-1251) to "a" (x-cp866).</p> </body> </html> </HTML>