Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>yes , <a href="http://www.gidforums.com/t-1816.html" rel="nofollow noreferrer">http://www.gidforums.com/t-1816.html</a></p> <pre><code>&lt;?php /** NAME : autolink() VERSION : 1.0 AUTHOR : J de Silva DESCRIPTION : returns VOID; handles converting URLs into clickable links off a string. TYPE : functions ======================================*/ function autolink( &amp;$text, $target='_blank', $nofollow=true ) { // grab anything that looks like a URL... $urls = _autolink_find_URLS( $text ); if( !empty($urls) ) // i.e. there were some URLS found in the text { array_walk( $urls, '_autolink_create_html_tags', array('target'=&gt;$target, 'nofollow'=&gt;$nofollow) ); $text = strtr( $text, $urls ); } } function _autolink_find_URLS( $text ) { // build the patterns $scheme = '(http:\/\/|https:\/\/)'; $www = 'www\.'; $ip = '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; $subdomain = '[-a-z0-9_]+\.'; $name = '[a-z][-a-z0-9]+\.'; $tld = '[a-z]+(\.[a-z]{2,2})?'; $the_rest = '\/?[a-z0-9._\/~#&amp;=;%+?-]+[a-z0-9\/#=?]{1,1}'; $pattern = "$scheme?(?(1)($ip|($subdomain)?$name$tld)|($www$name$tld))$the_rest"; $pattern = '/'.$pattern.'/is'; $c = preg_match_all( $pattern, $text, $m ); unset( $text, $scheme, $www, $ip, $subdomain, $name, $tld, $the_rest, $pattern ); if( $c ) { return( array_flip($m[0]) ); } return( array() ); } function _autolink_create_html_tags( &amp;$value, $key, $other=null ) { $target = $nofollow = null; if( is_array($other) ) { $target = ( $other['target'] ? " target=\"$other[target]\"" : null ); // see: http://www.google.com/googleblog/2005/01/preventing-comment-spam.html $nofollow = ( $other['nofollow'] ? ' rel="nofollow"' : null ); } $value = "&lt;a href=\"$key\"$target$nofollow&gt;$key&lt;/a&gt;"; } ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload