Model_hl.php 674 B

123456789101112131415161718192021
  1. <?php
  2. class Model_Hl extends Lin_Model {
  3. function __construct(){
  4. parent::__construct();
  5. }
  6. public function get_hl()
  7. {
  8. require_once "./data/snoopy/Snoopy.class.php";
  9. //$url = "http://data.bank.hexun.com/other/cms/fxjhjson.ashx?callback=PereMoreData";
  10. $url = "http://1.wepolicy.cn/";
  11. $snoopy = new Snoopy;
  12. @$snoopy->submit($url);
  13. $res = $snoopy->results;
  14. $res = file_get_contents($url);
  15. $res=iconv("GB2312","UTF-8//IGNORE",$res);
  16. $res=str_replace(array('PereMoreData(','currency','refePrice','code',"'",')'),array('','"currency"','"refePrice"','"code"','"',''),$res);
  17. $res = json_decode($res, true);
  18. return $res;
  19. }
  20. } //end class