php chinese word

方法一
<?php 
header('Content-type:text/html; charset=gb2312'); 
echo "这样输出就不会乱码"; 
$abc = "这样就会乱码了"; 
echo $abc; 
?> 

方法二
<?php 
echo "这样输出就不会乱码"; 
$abc = "这样就会乱码了"; 
echo html_entity_decode($abc, ENT_QUOTES, 'gb2312'); 
echo $abc; 
?>

 

加入 <HEAD> 中 
<? 
echo   " <meta   content=text/html;   charset=GB2312   http-equiv=Content-Type> "; 
?>

 

 

 

Email chinese wordl;

 

 

<?php
    $mail = new SaeMail();
    $mail->setOpt( array( 
        'from' => 'notsupport', 
        'to' => 'a@163.com,b@163.com', 
        'smtp_host' => 'smtp.gmail.com', 
        'smtp_port' => '587', 
        'smtp_username' => 'x@gmail.com', 
        'smtp_password' => '121212', 
        'subject' => 'subjuct', 
        'content' => 'content',
        'tls' => true
        ) );
 
    $ret = $mail->send();
    //发送失败时输出错误码和错误信息
    if ($ret === false)
        var_dump($mail->errno(), $mail->errmsg());
?>

 

posted @ 2012-08-01 21:04  Epirus  阅读(147)  评论(0编辑  收藏  举报