承接 matejch/html_helpers 相关项目开发

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

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

matejch/html_helpers

Composer 安装命令:

composer require matejch/html_helpers

包简介

Helper class for removing elements and content, and extracting file paths

README 文档

README

latest_tag

Two PHP helper classes for removing html tags and extracting file paths

Install in your project

composer require matejch/html_helpers "^1.0.0"

class HtmlTagRemover

With class HtmlTagRemover you can remove specified html tags and its content from html string

Example: remove tags based on name

$service = new HtmlTagRemover($htmlString);
service->removeTags(['a','img']);

Example: remove tags based on content of attribute

$service = new HtmlTagRemover($htmlString);

$service->removeTags(['a' => 'href[files]']);

/** remove 'a' tags where href attribute contains `files` substring and span elements contains class with `test` string */
$service->removeTags(['a' => 'href[files]','span' => 'class[test]']);

class HtmlFileExtractor

I created this class, because I needed to extract file paths from html before sending email, and add the as attachment

This class can return source from img or a tags automatically

But also from custom tags or attributes

Example: get file paths from img and a tag

$service = new HtmlFileExtractor($htmlString);

/** return files as array of strings directly from href and src */
$service->getFiles(['img','a'])

Example: get file paths other tags or specified attributes

/** return files as array of strings from class attributes of span elements */
$service->getFiles(['span' => 'class'])

$service->getFiles(['span' => 'class','img'=>'alt'])

/** return files as array of strings from class attributes of span elements, 
 * where class contains substring 'es' and from alt attribute of image tags
 */
$service->getFiles(['span' => 'class[es]','img'=>'alt'])

Remove package from your project

composer remove matejch/html_helpers

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固