(PHP >= 5.3) implementation of Autolinker.js a usefull javascript library for extract urls from text string.
Also, it will be possible ease porting back to ES6.
Using the static link() method:
$linkedText = Autolinker::quickLink( $textToAutolink[, $options] );
Using as a class:
$autolinker = new Autolinker( [ $options ] );
$linkedText = autolinker->link( $textToAutoLink );
Use the named array keys (equal js-object) for the $options
argument:
$options = [
'newWindow' => false,
'stripPrefix' => false
];
Take params from here