123456789101112131415161718192021 |
- <?php
- class Model_Hl extends Lin_Model {
- function __construct(){
- parent::__construct();
- }
- public function get_hl()
- {
- require_once "./data/snoopy/Snoopy.class.php";
- //$url = "http://data.bank.hexun.com/other/cms/fxjhjson.ashx?callback=PereMoreData";
- $url = "http://1.wepolicy.cn/";
- $snoopy = new Snoopy;
- @$snoopy->submit($url);
- $res = $snoopy->results;
- $res = file_get_contents($url);
- $res=iconv("GB2312","UTF-8//IGNORE",$res);
- $res=str_replace(array('PereMoreData(','currency','refePrice','code',"'",')'),array('','"currency"','"refePrice"','"code"','"',''),$res);
- $res = json_decode($res, true);
- return $res;
- }
- } //end class
|