kwstephenchan Posted March 21, 2009 Share Posted March 21, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/150436-need-help-with-mb_convert_encoding/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.