PHPackages                             haffoudhi/simplehtmldom - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. haffoudhi/simplehtmldom

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

haffoudhi/simplehtmldom
=======================

Simple html dom as a silex service

222PHP

Since May 9Pushed 12y ago1 watchersCompare

[ Source](https://github.com/MeTheGhost/silex_simple_html_dom)[ Packagist](https://packagist.org/packages/haffoudhi/simplehtmldom)[ RSS](/packages/haffoudhi-simplehtmldom/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

integrating simple\_html\_dom in silex framework
================================================

[](#integrating-simple_html_dom-in-silex-framework)

This is a simple silex service which integrates simple html dom into silex as a service .

Install instruction :

```
Via Composer :
  1 - Add this line to composer file: "haffoudhi/simplehtmldom": "@dev"
  2 - Then run composer update.
  3 - Register the new service in your bootstrap file $app->register(new Haffoudhi\Silex\SimpleHtmlDomServiceProvider());

Without Composer :
  1 - Copy the folder Haffoudhi under the src file of your silex project.
  2 - Register the new service in your bootstrap file $app->register(new Haffoudhi\Silex\SimpleHtmlDomServiceProvider());

```

How to use :

Now, afer you installed the service successfully, In your Controller,

```
1 - call the service : $simpleHtmlDom = $app['simpleHtmlDom'];
2 - Use simplehtmldom to get all the links from a string :
	  $content = file_get_contents(__DIR__ . '/anyWebPage.htm'); // $content can be the
	    //result of curl function or the content of html file, it's a string that contains the html source
  $simpleHtmlDom->load($content);
  // Find all links
  foreach($simpleHtmlDom->find('a') as $element) {
      echo $element->href . '';
  }
3 - Use simplehtmldom to get all the links from a file :
	  $simpleHtmlDom->load_file(__DIR__ . '/anyWebPage.htm'); // we introduce the path to the file
	  						           //that contains the html source
  // Find all links
  foreach($simpleHtmlDom->find('a') as $element) {
      echo $element->href . '';
  }

```

Final Notices,

```
1 - Need some assistance in data scraping, web scraping using silex and simple_html_dom
2 - You do have some problems implementing the service

```

then pull a new request i will answer as soon as possible.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/793b4c9152c8e0d0d44fd49d1b9fe36717e89a1ad91536f5f222a58810827ef9?d=identicon)[MeTheGhost](/maintainers/MeTheGhost)

---

Top Contributors

[![haffoudhi](https://avatars.githubusercontent.com/u/4338823?v=4)](https://github.com/haffoudhi "haffoudhi (23 commits)")

### Embed Badge

![Health badge](/badges/haffoudhi-simplehtmldom/health.svg)

```
[![Health](https://phpackages.com/badges/haffoudhi-simplehtmldom/health.svg)](https://phpackages.com/packages/haffoudhi-simplehtmldom)
```

###  Alternatives

[aune-io/magento2-product-category-url-fix

Product category url fix for Magento 2

165.9k](/packages/aune-io-magento2-product-category-url-fix)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
