[Php]
If (isset ($ _ GET ['order _ id']) & $ _ GET ['order _ id']! = ''){
$ Oid = $ _ GET ['order _ id'];
$ Result = $ db-> Execute ("select 'd _ no' from 'delimitery' where 'id' =". $ 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 ('/<table [^>] [^>] *> (.*?) <\/Table>/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]);
}
}
}
}