Multilinugal pages in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dj00791
Forum Newbie
Posts: 2
Joined: Tue Nov 23, 2010 1:30 am

Multilinugal pages in php

Post by dj00791 »

I am having an html code with multi lingual characters displayed. Same code when i use in php format. It gives ??????? instead of the multilingual characters.
Appreciate if any one can help me to resolve this.

PHP code

Code: Select all

<?php #String-UTF-8.php
# 
#
  $help_simplified = '简体中文网页';
  $help_tradition = '简体中文网页';
  print('<html>');
  print('<meta http-equiv="Content-Type"  content="text/html; charset=utf-8"/>');
  print('<body>');
  print('<b>Chinese string in UTF-8 in PHP</b><br/>');
  print($help_simplified.'<br/>');
  print($help_tradition.'<br/>');
  print('</body>');
  print('</html>');
?>
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Multilinugal pages in php

Post by Christopher »

Maybe because you are missing the <head></head> tags?

Code: Select all

<?php #String-UTF-8.php
# 
#
  $help_simplified = '简体中文网页';
  $help_tradition = '简体中文网页';
  print('<html>');
  print('<head>');
  print('<meta http-equiv="Content-Type"  content="text/html; charset=utf-8"/>');
  print('</head>');
  print('<body>');
  print('<b>Chinese string in UTF-8 in PHP</b><br/>');
  print($help_simplified.'<br/>');
  print($help_tradition.'<br/>');
  print('</body>');
  print('</html>');
?>
(#10850)
dj00791
Forum Newbie
Posts: 2
Joined: Tue Nov 23, 2010 1:30 am

Re: Multilinugal pages in php

Post by dj00791 »

Please see the output of the modified php file as per your suggestion
http://www.gameswiki.org/jd2.php

ITs still not working.

Regards,
John
Post Reply