elxnis Posted November 26, 2008 Report Share Posted November 26, 2008 Kādam nav aizķēries kāds labi strādājošs preg_replace skripts, lai veidotu hipersaites... $text = preg_replace("/\s(([a-zA-Z]+:\/\/)([a-z][a-z0-9_\..-]*[a-z]{2,6})([a-zA-Z0-9\/*-?&%]*))\s/i", " <a href=\"$1\">$1</a> ", $text); $text = preg_replace("/\s(www\.([a-z][a-z0-9_\..-]*[a-z]{2,6})([a-zA-Z0-9\/*-?&%]*))\s/i", " <a href=\"http://$1\">$1</a> ", $text); šis dažas saites neizveido... :) Link to comment Share on other sites More sharing options...
elxnis Posted November 28, 2008 Author Report Share Posted November 28, 2008 Nu ja nevar ar preg_replace, tad kā citādi var visus linkus, kas ir plain text pataisīt par klišķināmiem linkiem? Link to comment Share on other sites More sharing options...
martins256 Posted November 28, 2008 Report Share Posted November 28, 2008 iedod tos, kurus neparsē pareizi. Pirmajā tev vajag pielikt # vēl. Link to comment Share on other sites More sharing options...
Recommended Posts