Asi si ešte nepočul o
regulárnych výrazoch, ale to čo chceš oni zvládajú perfektne. Druhá vec je, že podobnú fičúrku používa veľa webov a kód sa v zásade nijak nelíši, takže stačí trošku
pogoogliť.
Kód:
$text = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $text);
_________________
A. S. Tanenbaum píše:
The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice.