<?php
define('HDOM_TYPE_ELEMENT', 1);
define('HDOM_TYPE_COMMENT', 2);
define('HDOM_TYPE_TEXT', 3);
define('HDOM_TYPE_ENDTAG', 4);
define('HDOM_TYPE_ROOT', 5);
define('HDOM_TYPE_UNKNOWN', 6);
define('HDOM_QUOTE_DOUBLE', 0);
define('HDOM_QUOTE_SINGLE', 1);
define('HDOM_QUOTE_NO', 3);
define('HDOM_INFO_BEGIN', 0);
define('HDOM_INFO_END', 1);
define('HDOM_INFO_QUOTE', 2);
define('HDOM_INFO_SPACE', 3);
define('HDOM_INFO_TEXT', 4);
define('HDOM_INFO_INNER', 5);
define('HDOM_INFO_OUTER', 6);
define('HDOM_INFO_ENDSPACE',7);
define('DEFAULT_TARGET_CHARSET', 'UTF-8');
define('DEFAULT_BR_TEXT', "\r\n");
define('DEFAULT_SPAN_TEXT', " ");
if (!defined('MAX_FILE_SIZE')) {
define('MAX_FILE_SIZE', 600000);
}
// helper functions
// -----------------------------------------------------------------------------
// get html dom from file
// $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1.
function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
{
// We DO force the tags to be terminated.
$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
do {
$repeat = false;
if ($context!==NULL)
{
// Test if "Accept-Encoding: gzip" has been set in $context
$params = stream_context_get_params($context);
if (isset($params['options']['http']['header']) && preg_match('/gzip/', $params['options']['http']['header']) !== false)
{
$contents = curl_file_get_contents('compress.zlib://'.$url, $use_include_path, $context, $offset);
}
else
{
$contents = curl_file_get_contents($url, $use_include_path, $context, $offset);
}
}
else
{
$contents = curl_file_get_contents($url, $use_include_path, NULL, $offset);
}
// test if the URL doesn't return a 200 status
if (isset($http_response_header) && strpos($http_response_header[0], '200') === false) {
// has a 301 redirect header been sent?
$pattern = "/^Location:\s*(.*)$/i";
$location_headers = preg_grep($pattern, $http_response_header);
if (!empty($location_headers) && preg_match($pattern, array_values($location_headers)[0], $matches)) {
// set the URL to that returned via the redirect header and repeat this loop
$url = $matches[1];
$repeat = true;
}
}
} while ($repeat);
// stop processing if the header isn't a good responce
if (isset($http_response_header) && strpos($http_response_header[0], '200') === false)
{
return false;
}
// stop processing if the contents are too big
if (empty($contents) || strlen($contents) > MAX_FILE_SIZE)
{
return false;
}
// The second parameter can force the selectors to all be lowercase.
$dom->load($contents, $lowercase, $stripRN);
return $dom;
}
// get html dom from string
function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
{
$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
if (empty($str) || strlen($str) > MAX_FILE_SIZE)
{
$dom->clear();
return false;
}
$dom->load($str, $lowercase, $stripRN);
return $dom;
}
// dump html dom tree
function dump_html_tree($node, $show_attr=true, $deep=0)
{
$node->dump($node);
}
/**
* simple html dom node
* PaperG - added ability for "find" routine to lowercase the value of the selector.
* PaperG - added $tag_start to track the start position of the tag in the total byte index
*
* @package PlaceLocalInclude
*/
class simple_html_dom_node
{
public $nodetype = HDOM_TYPE_TEXT;
public $tag = 'text';
public $attr = array();
public $children = array();
public $nodes = array();
public $parent = null;
// The "info" array - see HDOM_INFO_... for what each element contains.
public $_ = array();
public $tag_start = 0;
private $dom = null;
function __construct($dom)
{
$this->dom = $dom;
$dom->nodes[] = $this;
}
function __destruct()
{
$this->clear();
}
function __toString()
{
return $this->outertext();
}
// clean up memory due to php5 circular references memory leak...
function clear()
{
$this->dom = null;
$this->nodes = null;
$this->parent = null;
$this->children = null;
}
// dump node's tree
function dump($show_attr=true, $deep=0)
{
$lead = str_repeat(' ', $deep);
echo $lead.$this->tag;
if ($show_attr && count($this->attr)>0)
{
echo '(';
foreach ($this->attr as $k=>$v)
echo "[$k]=>\"".$this->$k.'", ';
echo ')';
}
echo "\n";
if ($this->nodes)
{
foreach ($this->nodes as $c)
{
$c->dump($show_attr, $deep+1);
}
}
}
// Debugging function to dump a single dom node with a bunch of information about it.
function dump_node($echo=true)
{
$string = $this->tag;
if (count($this->attr)>0)
{
$string .= '(';
foreach ($this->attr as $k=>$v)
{
$string .= "[$k]=>\"".$this->$k.'", ';
}
$string .= ')';
}
if (count($this->_)>0)
{
$string .= ' $_ (';
foreach ($this->_ as $k=>$v)
{
if (is_array($v))
{
$string .= "[$k]=>(";
foreach ($v as $k2=>$v2)
{
$string .= "[$k2]=>\"".$v2.'", ';
}
$string .= ")";
} else {
$string .= "[$k]=>\"".$v.'", ';
}
}
$string .= ")";
}
if (isset($this->text))
{
$string .= " text: (" . $this->text . ")";
}
$string .= " HDOM_INNER_INFO: '";
if (isset($node->_[HDOM_INFO_INNER]))
{
$string .= $node->_[HDOM_INFO_INNER] . "'";
}
else
{
$string .= ' NULL ';
}
$string .= " children: " . count($this->children);
$string .= " nodes: " . count($this->nodes);
$string .= " tag_start: " . $this->tag_start;
$string .= "\n";
if ($echo)
{
echo $string;
return;
}
else
{
return $string;
}
}
// returns the parent of node
// If a node is passed in, it will reset the parent of the current node to that one.
function parent($parent=null)
{
// I am SURE that this doesn't work properly.
// It fails to unset the current node from it's current parents nodes or children list first.
if ($parent !== null)
{
$this->parent = $parent;
$this->parent->nodes[] = $this;
$this->parent->children[] = $this;
}
return $this->parent;
}
// verify that node has children
function has_child()
{
return !empty($this->children);
}
// returns children of node
function children($idx=-1)
{
if ($idx===-1)
{
return $this->children;
}
if (isset($this->children[$idx])) r
没有合适的资源?快使用搜索试试~ 我知道了~
基于PHP的最新四端同步影视源码苹果cms影视四端APIcloud混合原生APP源码.zip
共866个文件
php:200个
png:182个
js:165个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 177 浏览量
2023-10-10
21:38:18
上传
评论 1
收藏 11.82MB ZIP 举报
温馨提示
基于PHP的最新四端同步影视源码苹果cms影视四端APIcloud混合原生APP源码.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于PHP的最新四端同步影视源码苹果cms影视四端APIcloud混合原生APP源码.zip (866个子文件)
8f7faf656e5b8fdce4cc3ab9e5abd7e7 14KB
web.config 16KB
oneui.css 305KB
main.css 238KB
summernote-bs3.css 149KB
bootstrap.min.css 135KB
style.css 112KB
bootstrap.min.css 111KB
bootstrap.css 106KB
yzmplayer.css 63KB
add-ons.min.css 52KB
aui-hall.css 48KB
style.min.css 46KB
jquery.mCustomScrollbar.min.css 42KB
news.css 35KB
stui_block.css 34KB
datepicker3.css 34KB
font-awesome.min.css 30KB
bootkit.css 29KB
jquery-ui-1.10.4.min.css 27KB
theme.css 25KB
jquery-ui-1.10.4.custom.css 24KB
default.css 21KB
bootstrap-editable.css 21KB
font-awesome.min.css 20KB
swiper.min.css 17KB
player.css 16KB
stui_default.css 15KB
layer.css 14KB
layer.css 14KB
layer.css 14KB
mCustomScrollbar.css 14KB
fullcalendar.css 12KB
dropzone.css 12KB
iconfont.css 10KB
jquery.mmenu.css 8KB
summernote.css 8KB
skycons.css 8KB
magnific-popup.css 8KB
default.css 7KB
blackcolor.css 6KB
whitecolor.css 5KB
layer.css 5KB
stui_custom.css 5KB
index.css 4KB
xcharts.min.css 4KB
iconfont.css 4KB
bootstrap-colorpicker.css 4KB
install.css 4KB
zhibo.css 4KB
tv.css 4KB
small.css 4KB
bootstrap-timepicker.css 4KB
datepicker-theme.css 3KB
down.css 3KB
qq.css 3KB
iconfont.css 3KB
simple.css 2KB
aui.css 2KB
phone_style.css 1KB
bootstrap-tagsinput.css 1KB
prettify.css 973B
bootstrap-markdown.min.css 844B
morris.css 445B
fontawesome-webfont.eot 162KB
fontawesome-webfont.eot 71KB
fontawesome-webfont.eot 71KB
weathericons-regular-webfont.eot 34KB
weathericons-regular-webfont.eot 34KB
iconfont.eot 24KB
glyphicons-halflings-regular.eot 20KB
glyphicons-halflings-regular.eot 20KB
glyphicons-halflings-regular.eot 20KB
climacons-webfont.eot 18KB
iconfont.eot 9KB
loading.gif 318KB
ico_loading.gif 74KB
load.gif 61KB
static.gif 35KB
guanggao.gif 14KB
35.gif 13KB
42.gif 13KB
40.gif 10KB
18.gif 8KB
19.gif 8KB
11.gif 8KB
32.gif 7KB
49.gif 6KB
29.gif 6KB
loading-0.gif 6KB
97.gif 5KB
65.gif 5KB
31.gif 5KB
46.gif 5KB
57.gif 5KB
45.gif 5KB
8.gif 5KB
43.gif 4KB
33.gif 4KB
68.gif 4KB
共 866 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
毕业_设计
- 粉丝: 1930
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功