PHPackages                             jmbtechnologylimited/linkify - 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. jmbtechnologylimited/linkify

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

jmbtechnologylimited/linkify
============================

Converts URLs and email addresses in text into HTML links

v1.1.2(12y ago)0352[1 issues](https://github.com/JMB-Technology-Limited/php-linkify/issues)[1 PRs](https://github.com/JMB-Technology-Limited/php-linkify/pulls)MITPHPPHP &gt;=5.3.0

Since Oct 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/JMB-Technology-Limited/php-linkify)[ Packagist](https://packagist.org/packages/jmbtechnologylimited/linkify)[ Docs](https://github.com/misd-service-development/php-linkify)[ RSS](/packages/jmbtechnologylimited-linkify/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

Linkify Fork
============

[](#linkify-fork)

[![Build Status](https://camo.githubusercontent.com/b3c7ba2c1b563807e5c9a0c04c353a64ea6d9f88c5bd55ad8d12c659b718be68/68747470733a2f2f6170692e7472617669732d63692e6f72672f4a4d422d546563686e6f6c6f67792d4c696d697465642f7068702d6c696e6b6966792e706e67)](http://travis-ci.org/misd-service-development/php-linkify)

Converts URLs and email addresses into clickable links. It works on both snippets of HTML (or plain text) and complete HTML pages.

There are many regex variations shared on the internet for performing this task, but few are robust. Linkify contains a large number of unit tests to counter this.

It does not cover every possible valid-yet-never-used URLs and email addresses in order to handle 'real world' usage (eg no 'gopher://'). This means, for example, that it copes better with punctuation errors.

It was forked in March 2019 as the original maintainers have stopped responding. See

Authors
-------

[](#authors)

- Chris Wilkinson
- JMB Technology

It uses regex based on John Gruber's [Improved Liberal, Accurate Regex Pattern for Matching URLs](http://daringfireball.net/2010/07/improved_regex_for_matching_urls).

Installation
------------

[](#installation)

`composer require jmbtechnologylimited/linkify`

Usage
-----

[](#usage)

```
$linkify = new \Misd\Linkify\Linkify();
$text = 'This is my text containing a link to www.example.com.';

echo $linkify->process($text);
```

Will output:

```
This is my text containing a link to www.example.com.
```

### Options

[](#options)

Options set on the constructor will be applied to all links. Alternatively you can place the options on a method call. The latter will override the former.

```
$linkify = new \Misd\Linkify\Linkify(array('attr' => array('class' => 'foo')));
$text = 'This is my text containing a link to www.example.com.';

echo $linkify->process($text);
```

Will output:

```
This is my text containing a link to www.example.com.
```

Whereas:

```
$linkify = new \Misd\Linkify\Linkify(array('attr' => array('class' => 'foo')));
$text = 'This is my text containing a link to www.example.com.';

echo $linkify->process($text, array('attr' => array('class' => 'bar')));
```

Will output:

```
This is my text containing a link to www.example.com.
```

Available options are:

#### `attr`

[](#attr)

An associative array of HTML attributes to add to the link. For example:

```
array('attr' => array('class' => 'foo', 'style' => 'font-weight: bold; color: red;')
```

#### `callback`

[](#callback)

A closure to call with each url match. The closure will be called for each URL found with three parameters: the url, the caption and a boolean `isEmail` (if `$isEmail` is true, then `$url` is equals to `$caption`.

If the callback return a non-null value, this value replace the link in the resulting text. If null is returned, the usual `CAPTION` is used.

```
$linkify = new \Misd\Linkify\Linkify(array('callback' => function($url, $caption, $isEmail) {
    return '' . $caption . '';
}));
echo $linkify->process('This link will be converted to bold: www.example.com.'));
```

Developers
----------

[](#developers)

There is a vagrant box. Simply ssh in and type `test` to test.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 78.6% 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.

###  Release Activity

Cadence

Every ~193 days

Total

4

Last Release

4385d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c67fb5728b12a437aad45dc2b739ab6b7b2e43607552684ca1c93cd9d2f0adf8?d=identicon)[jmbtech](/maintainers/jmbtech)

---

Top Contributors

[![thewilkybarkid](https://avatars.githubusercontent.com/u/1784740?v=4)](https://github.com/thewilkybarkid "thewilkybarkid (66 commits)")[![jarofgreen](https://avatars.githubusercontent.com/u/85656?v=4)](https://github.com/jarofgreen "jarofgreen (11 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (2 commits)")[![edea](https://avatars.githubusercontent.com/u/1705717?v=4)](https://github.com/edea "edea (1 commits)")[![arthurdarcet](https://avatars.githubusercontent.com/u/973454?v=4)](https://github.com/arthurdarcet "arthurdarcet (1 commits)")[![KaneCohen](https://avatars.githubusercontent.com/u/578455?v=4)](https://github.com/KaneCohen "KaneCohen (1 commits)")[![miclf](https://avatars.githubusercontent.com/u/3188746?v=4)](https://github.com/miclf "miclf (1 commits)")[![bartgloudemans](https://avatars.githubusercontent.com/u/411451?v=4)](https://github.com/bartgloudemans "bartgloudemans (1 commits)")

---

Tags

urllinkconvertemail address

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jmbtechnologylimited-linkify/health.svg)

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

###  Alternatives

[misd/linkify

Converts URLs and email addresses in text into HTML links

1122.9M10](/packages/misd-linkify)[jbroadway/urlify

A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

6737.4M62](/packages/jbroadway-urlify)[spatie/url

Parse, build and manipulate URL's

73914.3M97](/packages/spatie-url)[league/uri-components

URI components manipulation library

31932.3M67](/packages/league-uri-components)[nahid/linkify

Converts URLs and email addresses in text into HTML links its extended from Misd\\Linify its also support laravel 5

11136.0k1](/packages/nahid-linkify)[sabre/uri

Functions for making sense out of URIs.

29335.2M40](/packages/sabre-uri)

PHPackages © 2026

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