Skip to content

Instantly share code, notes, and snippets.

@leepowers
leepowers / gist:5529546
Last active December 17, 2015 01:38
Auto-link URLs in an HTML document that haven't already been linked.
<?php
/**
* Safely auto-link HTML content.
* Doesn't double-link existing content.
* Plus logging features
* @param string $html
* @return string
*/
function safe_autolink($html) {