Php class for live rate from Vietcomebank

    Rating: ★★★★☆
    View: 201
    Download: 148
    Từ khóa:

    Usage: 

    - This class php configurated to time for load and draw data at local file each one hour.

    - You can deploy this class for any web ecomercial, news web, etc,...

    Explaine:

    
    $validatelocal='rawdata/ExrateXML.aspx';
    $validatelocalfile=file_get_contents($validatelocal);
    preg_match_all('@(.*?)@',$validatelocalfile,$times,PREG_SET_ORDER);
    $timnenow=time();
    $timewrited=(int)$times[0][1]+3600;
    if ($timnenow>$timewrited)
    {
    $footer_aspx = ''.time().'';
    $url='http://www.vietcombank.com.vn/ExchangeRates/ExrateXML.aspx';
    $getcontent=file_get_contents($url);
    $html = fopen("rawdata/ExrateXML.aspx", "w+");
    fwrite($html, $getcontent);
    fwrite($html,$footer_aspx);
    fclose($html);
    }
    
    loading Đang tải...

    api được ưa chuộng