您的位置:首页 > 编程语言 > PHP开发

php简单的数据采集

2013-11-22 17:52 302 查看
<?php

    function str_substr($start, $end, $str) // 字符串截取函数     

    {     

        $temp = explode($start, $str, 2);     

        $content = explode($end, $temp[1], 2);     

        return $content[0];     

    }

    $url = "https://www.okcoin.com/";

    $r = file_get_contents($url);

    

    //echo ('标题: ' . str_substr("<title>", "</title>", $r));

    echo ( str_substr('<span id="bannerBtcLast">', '</span>', $r));

    

?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: