francescobruno-cmv/clickable-links

Converte URL e indirizzi email in tag anchor HTML cliccabili.

Maintainers

Package info

github.com/FrancescoBruno-cmv/clickable-links

pkg:composer/francescobruno-cmv/clickable-links

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.0.3 2026-05-06 06:20 UTC

This package is auto-updated.

Last update: 2026-05-06 06:21:54 UTC


README

Latest Version on Packagist Total Downloads License

Una libreria PHP leggera che converte automaticamente URL, indirizzi email, link FTP e handle Skype presenti in una stringa di testo in tag HTML anchor cliccabili (<a href="...">).

โœจ Features

  • โœ… Converte URL con protocollo (http://, https://, ecc.)
  • ๐ŸŒ Converte URL www. e wap. anche senza protocollo
  • ๐Ÿ“ Converte link ftp. con protocollo corretto
  • ๐Ÿ“ง Converte indirizzi email in link mailto:
  • ๐Ÿ’ฌ Supporta handle Skype (skype:username)
  • ๐Ÿ”“ Gestisce automaticamente le HTML entities in input
  • ๐Ÿ”— Tutti i link si aprono in nuova scheda (target="_blank")
  • โšก Zero dipendenze โ€” PHP puro, nessun pacchetto esterno

๐Ÿ“ฆ Installazione

Installa il pacchetto tramite Composer:

composer require francescobruno-cmv/clickable-links

โš™๏ธ Requisiti

  • PHP >= 7.4

๐Ÿš€ Utilizzo

use FrancescoBrunoCmv\ClickableLinks\Linkifier;

$text = "Visita https://example.com o scrivici a info@example.com";

echo Linkifier::process($text);
// Visita <a href="https://example.com" target="_blank">https://example.com</a>
// o scrivici a <a href="mailto:info@example.com" target="_blank">info@example.com</a>

๐Ÿ” Pattern riconosciuti

Pattern Esempio input href generato
URL con protocollo https://example.com/page https://example.com/page
URL HTTP http://example.com http://example.com
URL WWW www.example.com http://www.example.com
URL WAP wap.example.com http://wap.example.com
URL FTP ftp.example.com ftp://ftp.example.com
Email user@example.com mailto:user@example.com
Email con prefisso mailto:user@example.com mailto:user@example.com
Skype skype:username skype:username

๐Ÿ“ Esempi

// URL HTTPS
Linkifier::process("Visita https://example.com");
// โ†’ Visita <a href="https://example.com" target="_blank">https://example.com</a>

// WWW senza protocollo
Linkifier::process("Vai su www.example.com");
// โ†’ Vai su <a href="http://www.example.com" target="_blank">www.example.com</a>

// Email
Linkifier::process("Scrivi a hello@example.com");
// โ†’ Scrivi a <a href="mailto:hello@example.com" target="_blank">hello@example.com</a>

// Skype
Linkifier::process("Chiamami su skype:myusername");
// โ†’ Chiamami su <a href="skype:myusername" target="_blank">skype:myusername</a>

// Contenuto misto
Linkifier::process("Sito: www.example.com | Email: info@example.com | FTP: ftp.example.com");
// โ†’ Tutti e tre convertiti in anchor tag cliccabili

๐Ÿค Contributi

Le contribuzioni sono benvenute!

  1. Fai fork del progetto
  2. Crea un branch (feature/nome-feature)
  3. Commit delle modifiche
  4. Push sul branch
  5. Apri una Pull Request

๐Ÿ“„ Licenza

Questo pacchetto รจ distribuito sotto licenza MIT.
Vedi il file LICENSE.md per maggiori dettagli.

๐Ÿ‘ค Autore

Francesco Bruno

โญ Supporto

Se il pacchetto ti รจ utile, lascia una โญ su GitHub!