Skip to content

Instantly share code, notes, and snippets.

@kitek
Created November 23, 2011 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitek/1388261 to your computer and use it in GitHub Desktop.
Save kitek/1388261 to your computer and use it in GitHub Desktop.
Prosty parser linków
<?
// Bardzo prosty parser linków
$html = preg_replace(
'#(([^ \'\"\<]+)?[^ \'\"\.\<]+\.(pl|com|net|org)(\/[^ \'\"\<]+)?)#',
'<a href="http://$1" target="_blank" rel="nofollow">$1</a>',
$html
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment