2017 © Pedro Peláez
 

library clickable

A simple utility to convert URLs and emails in a string to clickable HTML anchors

image

theprivateer/clickable

A simple utility to convert URLs and emails in a string to clickable HTML anchors

  • Thursday, July 27, 2017
  • by theprivateer
  • Repository
  • 0 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Clickable

A simple utility to convert URLs and emails in a string to clickable HTML anchors., (*1)

Installation

The package can be installed using Composer:, (*2)

composer require theprivateer/clickable

Usage

To use it, it's just a matter of passing a string to the static parse method on the class:, (*3)

require_once 'path/to/composer/autoload.php';

echo \Privateer\Clickable\Clickable::parse('Read my blog at https://philstephens.io');

// Read my blog at <a href="https://philstephens.io" rel="nofollow">https://philstephens.io</a>

Alternatively you can use the str_clickable helper function (also autoloaded by Composer):, (*4)

require_once 'path/to/composer/autoload.php';

$str = 'Find out more at https://packagist.org/packages/theprivateer/clickable.';

echo str_clickable($str)

// Find out more at <a href="https://packagist.org/packages/theprivateer/clickable" rel="nofollow">https://packagist.org/packages/theprivateer/clickable</a>.

If you pass through a string that already has an anchor tag in it, fear not - the parser will automatically ignore them:, (*5)

require_once 'path/to/composer/autoload.php';

$str = 'Find out more at <a href="https://packagist.org/packages/theprivateer/clickable" rel="nofollow">https://packagist.org/packages/theprivateer/clickable</a>.';

echo str_clickable($str)

// Find out more at <a href="https://packagist.org/packages/theprivateer/clickable" rel="nofollow">https://packagist.org/packages/theprivateer/clickable</a>.

The Versions

27/07 2017

dev-master

9999999-dev https://github.com/theprivateer/clickable

A simple utility to convert URLs and emails in a string to clickable HTML anchors

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

url html

27/07 2017

v1.0.1

1.0.1.0 https://github.com/theprivateer/clickable

A simple utility to convert URLs and emails in a string to clickable HTML anchors

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

url html

18/07 2017

v1.0

1.0.0.0 https://github.com/theprivateer/clickable

A simple utility to convert URLs and emails in a string to clickable HTML anchors

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

url html