Jump to content

Need help with mb_convert_encoding


kwstephenchan

Recommended Posts

What I am trying to do is to put the trailer informaton of each page into a common module and then calling this function from each page thus I do not need to go to every page to change if something has to be changed. The problem is that the characters are in Chinese. If I put these characters into the page without using the common module, it displays fine. But once I put them into the separate module, it displays funny characters.

 

The following are the codes:

 

The following codes are placed in a commomo module file called : module/common.php

 

function trailer() {

echo '<table width="800" border="0" align="center" cellpadding="1" cellspacing="1">';

echo '<tr height="20" colspan="5"><div> </div></tr>';

echo "<tr>";

$about="关于我们";

$about=mb_convert_encoding($about,"UTF-8");

echo  '<div id="siteInfo"><font size="2"> <a href="aboutus.php">'.$about.'</a> | <a href="#">网站地图</a> | <a

 

href="#">免责声明</a> | <a href="contactus.php">联系我们</a>  </font></div>';

echo '</tr>';

echo '</table>';

}

 

 

 

The following is the main program :

 

<?php

include ('module/common.php');

session_start();

?>

 

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>

<body>

<?php

trailer();

?>

</body>

</html>

 

 

can someone help?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.