开发者

Display special characters in PHP

test.php - Using regular IDE(phpDesigner7)

<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>

<?php
      echo "بوغاليا";
?>

</body>
</html>

output : ???????

test.html - Using regular IDE(phpDesigner7)

<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
بوغاليا
</body>
</html>

output : ???????

test.html - Using Arabic Pad

<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
بوغاليا
</body>
</html>

output : بوغاليا

hello.php - Using Arabic Pad

<?php 
 echo "Hello";
 ?>

output : Nothing

I am running a local WAMP(PHP 5.3). From this.

I have tried saving these pages with : charset=utf-8 as well on both the programs with no luck.

I know for fact that my IDE can't handle special characters and the other program that Can handle special characters can write workable HTML but if PHP file开发者_StackOverflows are written in it, It will not work. I know this is an encoding issue(in the IDE and while displaying the pages).

How does one go about displaying special characters with PHP code, I have large chunks of this arabic text that needs to be displayed.

Do you know how is this done?

Thanks! :)


Why are you setting your charset to iso-8859-1? That's Latin-1. You can't render non-Latin characters in Latin-1.

Try using UTF-8 instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜