php-linkify
php-linkify copied to clipboard
Add an option to only linkify URLs that start with a scheme
Adding a require_scheme
option allows a user to disable auto-linking of things that look like URLs (e.g. www.example.com
), so that only full URLs (e.g. https://www.example.com
) are auto-linked. The scheme currently has to match ~^(ht|f)tps?://~
.
Example usage:
$html = $linkify->processUrls($html, [
'require_scheme' => true
]);