PHP头条
热点:

php采集中国代理服务器网的方法


本文实例讲述了php采集中国代理服务器网的方法。分享给大家供大家参考。具体如下:

<?php
/**
 * 采集中国代理服务器网 最新列表
 */
class proxy
{
  /* 需采集列表  */
  public $list;
  /* 代理列表 保存路径 */
  public $save_path = 'proxy.txt';
  /* 获取采集列表 */
  function get_list($page)
  {
    $url = 'http://www.cnproxy.com/proxy(*).html';
    // 处理列表
    $this->list = preg_replace('/\(\*\)/', $page, $url);
    return $this->list;
  }
  /* 采集代理内容 */
  function get($page)
  {
    $this->get_list($page);
    $file = stripslashes(file_get_contents($this->list));
    $zz = '/([0-9\.]+)

相关文章

PHP之友评论

今天推荐