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));
?>
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));
?>
相关文章推荐
- 基于PHP的简单采集数据入库程序
- 基于PHP的简单采集数据入库程序【续篇】
- 基于PHP的简单采集数据入库程序
- 基于PHP的简单采集数据入库程序
- 简单数据采集(http://blog.jobbole.com/tag/php/)
- flume + Kafka采集数据 超简单
- PHP(CURL)POST数据调用API简单示例
- php多线程采集网页数据-php采集网页-php爬虫视频教程8
- php正则与数据采集
- PHP用curl模拟登陆并采集后台数据
- PHP变量常量数据类型简单罗列
- wamp下PHP报错,MySQL数据库插入数据乱码可以设置一下header解决简单问题
- php xml留言板 xml存储数据的简单例子
- PHP数据采集常用的方法
- PHP中使用snoopy采集类进行数据抓取
- 从数据库调出数据显示到页面 PHP+Mysql+Html(简单实例)
- 简单的PHP数据后台实现用户登录
- 深入php数据采集的详解
- android客户端与php服务器的json数据简单交互(一)