Return to Snippet

Revision: 53448
at November 23, 2011 12:32 by yllumi


Updated Code
//1. comment these lines in text_helper.php
if (preg_match("!\[url.+\]|://|wwww.!", $line))
{
    break;
}

//2. find this script in url_helper.php,
$str = str_replace($matches['0'][$i],
        $matches['1'][$i].'<a href="http'.
        $matches['4'][$i].'://'.
	$matches['5'][$i].
        $matches['6'][$i].'"'.$pop.'>http'.
	$matches['4'][$i].'://'.
	$matches['5'][$i].
	$matches['6'][$i].'</a>'.
	$period, $str);

//and replace with this,
$str = str_replace($matches['0'][$i],
        $matches['1'][$i].'<a {unwrap} href="http'.
        $matches['4'][$i].'://'.
	$matches['5'][$i].
        $matches['6'][$i].'" {/unwrap} '.$pop.'>http'.
	$matches['4'][$i].'://'.
	$matches['5'][$i].
	$matches['6'][$i].'</a>'.
	$period, $str);

//3. then use with word_wrap() from text_helper.php

echo word_wrap(auto_link($string));

Revision: 53447
at November 23, 2011 12:10 by yllumi


Updated Code
//find this script in url_helper.php,

$str = str_replace($matches['0'][$i],
        $matches['1'][$i].'<a href="http'.
        $matches['4'][$i].'://'.
	$matches['5'][$i].
        $matches['6'][$i].'"'.$pop.'>http'.
	$matches['4'][$i].'://'.
	$matches['5'][$i].
	$matches['6'][$i].'</a>'.
	$period, $str);

//and replace with this,

$str = str_replace($matches['0'][$i],
        $matches['1'][$i].'<a {unwrap} href="http'.
        $matches['4'][$i].'://'.
	$matches['5'][$i].
        $matches['6'][$i].'" {/unwrap} '.$pop.'>http'.
	$matches['4'][$i].'://'.
	$matches['5'][$i].
	$matches['6'][$i].'</a>'.
	$period, $str);

//then use with word_wrap() from text_helper.php

echo word_wrap(auto_link($string));

Revision: 53446
at November 23, 2011 12:08 by yllumi


Initial Code
//find this script in url_helper.php,

$str = str_replace($matches['0'][$i],
        $matches['1'][$i].'<a href="http'.
        $matches['4'][$i].'://'.
	$matches['5'][$i].
        $matches['6'][$i].'"'.$pop.'>http'.
	$matches['4'][$i].'://'.
	$matches['5'][$i].
	$matches['6'][$i].'</a>'.
	$period, $str);

//and replace with this,

$str = str_replace($matches['0'][$i],
        $matches['1'][$i].'<a {unwrap} href="http'.
        $matches['4'][$i].'://'.
	$matches['5'][$i].
        $matches['6'][$i].'" {/unwrap} '.$pop.'>http'.
	$matches['4'][$i].'://'.
	$matches['5'][$i].
	$matches['6'][$i].'</a>'.
	$period, $str);

Initial URL


Initial Description
solving unwrapped link in auto_link() function

Initial Title
unwrap link in codeigniter auto_link

Initial Tags
codeigniter

Initial Language
PHP