首頁 > 後端開發 > php教程 > PHP转换国际编码_PHP教程

PHP转换国际编码_PHP教程

WBOY
發布: 2016-07-13 17:54:21
原創
875 人瀏覽過

[php] 
if(isset($_GET['order_id']) && $_GET['order_id']!==''){ 
                    $oid=$_GET['order_id']; 
                    $result=$db->Execute("select `d_no` from `delivery` where `oid`=".$oid); 
                    $delivery_no=''; 
                    if($result->RecordCount()>0){ 
                        while(!$result->EOF){ 
                            $delivery_no=$result->fields['d_no']; 
                            $result->MoveNext(); 
                            } www.2cto.com
                        if($delivery_no!==''){           
                                $html=file_get_contents('http://tracking.post.japanpost.jp/service/singleSearch.do?searchKind=S004&locale=ja&reqCodeNo1='.$delivery_no);     
                                if($html){ 
                                    preg_match_all('/

][^>]*>(.*?) /si',$html,$tables);  
                                    unset($tables[0]); 
                                    function getUTFString($string){ 
                                        $encoding = mb_detect_encoding($string, array('ASCII','UTF-8','Shift-JIS','GB2312','GBK','BIG5')); 
                                        return iconv($encoding,'UTF-8',$string); 
                                        //return mb_convert_encoding($string, 'utf-8', $encoding); 
                                    } 
                                    echo getUTFString($tables[1][4]); 
                                    } 
                            } 
                        } 
                    } 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477968.htmlTechArticle[php] if(isset($_GET[order_id]) $_GET[order_id]!==){ $oid=$_GET[order_id]; $result=$db-Execute(select `d_no` from `delivery` where `oid`=.$oid); $delivery_no=; if($result-RecordCoun...
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板