PHPackages                             iamcal/lib\_autolink - 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. iamcal/lib\_autolink

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

iamcal/lib\_autolink
====================

Adds anchors to urls in a text

v1.9(3y ago)631.3M↓33.9%22[7 issues](https://github.com/iamcal/lib_autolink/issues)3MITPHP

Since Apr 10Pushed 2y ago6 watchersCompare

[ Source](https://github.com/iamcal/lib_autolink)[ Packagist](https://packagist.org/packages/iamcal/lib_autolink)[ RSS](/packages/iamcal-lib-autolink/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (5)Used By (3)

lib\_autolink - PHP HTML link formatting library
================================================

[](#lib_autolink---php-html-link-formatting-library)

[![Build Status](https://github.com/iamcal/lib_autolink/actions/workflows/php.yml/badge.svg)](https://github.com/iamcal/lib_autolink/actions)[![Latest Stable Version](https://camo.githubusercontent.com/9b45f7b198fc6e83b4ec8b5edf82d1c4120aacf0bdfaf80b947b57e9875c3de5/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69616d63616c2f6c69625f6175746f6c696e6b2e7376673f7374796c653d666c6174)](https://packagist.org/packages/iamcal/lib_autolink)

Find URLs in HTML that are not already links, and make them into links.

Looking to do this in JavaScript?

Usage
-----

[](#usage)

```
include('lib_autolink.php');

# simple mode
$html = autolink($html);

# truncate URLs longer than 20 characters
$html = autolink($html, 20);

# insert some magic into the  tags
$html = autolink($html, 30, ' class="mylink"');

# By default if the display url is truncated, a title attribute is added to the link, if you don't want this, add a 4th parameter of false
$html = autolink($html, 30, ' class="mylink"', false);

# link up email address
$html = autolink_email($html);

```

Testing
-------

[](#testing)

If you have perl's [Test::Harness](http://search.cpan.org/dist/Test-Harness/) installed (you almost certainly do), you can run the tests using:

```
prove --exec 'php' t/*.t

```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity53

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 80.8% 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 ~1147 days

Total

4

Last Release

1344d ago

### Community

Maintainers

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

---

Top Contributors

[![iamcal](https://avatars.githubusercontent.com/u/173750?v=4)](https://github.com/iamcal "iamcal (42 commits)")[![rickard2](https://avatars.githubusercontent.com/u/488425?v=4)](https://github.com/rickard2 "rickard2 (2 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (2 commits)")[![yguedidi](https://avatars.githubusercontent.com/u/1480128?v=4)](https://github.com/yguedidi "yguedidi (2 commits)")[![lsmith77](https://avatars.githubusercontent.com/u/300279?v=4)](https://github.com/lsmith77 "lsmith77 (1 commits)")[![CodeLingoBot](https://avatars.githubusercontent.com/u/45469328?v=4)](https://github.com/CodeLingoBot "CodeLingoBot (1 commits)")[![DennisStanistan](https://avatars.githubusercontent.com/u/16765551?v=4)](https://github.com/DennisStanistan "DennisStanistan (1 commits)")[![cedric-anne](https://avatars.githubusercontent.com/u/33253653?v=4)](https://github.com/cedric-anne "cedric-anne (1 commits)")

---

Tags

linkanchorautolink

### Embed Badge

![Health badge](/badges/iamcal-lib-autolink/health.svg)

```
[![Health](https://phpackages.com/badges/iamcal-lib-autolink/health.svg)](https://phpackages.com/packages/iamcal-lib-autolink)
```

###  Alternatives

[jbroadway/urlify

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

6737.4M62](/packages/jbroadway-urlify)[misd/linkify

Converts URLs and email addresses in text into HTML links

1122.9M10](/packages/misd-linkify)[asika/autolink

Auto convert url to link anchor.

34454.0k2](/packages/asika-autolink)[nojimage/twitter-text-php

A library of PHP classes that provide auto-linking and extraction of usernames, lists, hashtags and URLs from tweets.

1241.9M7](/packages/nojimage-twitter-text-php)[carlson/nova-link-field

A Laravel Nova field for HTML links.

22426.3k](/packages/carlson-nova-link-field)[shivella/laravel-bitly

Laravel package for generating bitly url

75789.0k1](/packages/shivella-laravel-bitly)

PHPackages © 2026

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