承接 elecena/xml-iterator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elecena/xml-iterator

最新稳定版本:0.4.0

Composer 安装命令:

composer require elecena/xml-iterator

包简介

Memory efficient and fast XML parser with iterator interface

README 文档

README

Test

Memory efficient and fast XML parser with the iterator interface.

Usage example

Getting the list of sub-sitemaps in the remote XML sitemap file.

use Elecena\XmlIterator\XMLParser;
use Elecena\XmlIterator\Nodes\XMLNodeOpen;
use Elecena\XmlIterator\Nodes\XMLNodeContent;

require 'vendor/autoload.php';

$stream = fopen('https://elecena.pl/sitemap.xml', mode: 'rt');

foreach(new XMLParser($stream) as $node) {
    if ($node instanceof XMLNodeContent && $node->name === 'loc') {
		echo "Sub-sitemap found: {$node->content}\n";
    }
	elseif ($node instanceof XMLNodeOpen && $node->name === 'sitemapindex') {
		echo "Sitemap index node found, attributes: " . print_r($node->attributes, return: true) . "\n";
	}
}

fclose($stream);

The above will give you:

Sitemap index node found: Array
(
    [xmlns] => http://www.sitemaps.org/schemas/sitemap/0.9
)

Sub-sitemap found: https://elecena.pl/sitemap-001-search.xml.gz
Sub-sitemap found: https://elecena.pl/sitemap-002-shops.xml.gz
Sub-sitemap found: https://elecena.pl/sitemap-003-pages.xml.gz
Sub-sitemap found: https://elecena.pl/sitemap-004-datasheets.xml.gz
Sub-sitemap found: https://elecena.pl/sitemap-005-datasheets.xml.gz
Sub-sitemap found: https://elecena.pl/sitemap-006-datasheets.xml.gz
(...)

统计信息

  • 总下载量: 2.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固