public function urlParser($str, $rule)
    {
        $linkify = new Linkify(['callback' => function ($url, $caption, $isEmail) use ($rule) {
            $rule = str_replace('[url]', $url, $rule);
            $rule = str_replace('[caption]', $caption, $rule);
            return $rule;
        }]);

        return $linkify->process($str);
    }
public function urlParser($str, $rule)
    {
        $linkify = new Linkify(['callback' => function ($url, $caption, $isEmail) use ($rule) {
            $rule = str_replace('[url]', $url, $rule);
            $rule = str_replace('[caption]', $caption, $rule);
            return $rule;
        }]);

        return $linkify->process($str);
    }
public function urlParser ( $ str , $ rule ) { $ linkify = new Linkify ( [ 'callback' => function ( $ url , $ caption , $ isEmail ) use ( $ rule ) { $ rule = str_replace ( '[url]' , $ url , $ rule ) ; $ rule = str_replace ( '[caption]' , $ caption , $ rule ) ; return $ rule ; } ] ) ; return $ linkify -> process ( $ str ) ; }
Parse URLs from string
@param  string $str
@param  string $rule substitution rule, for example: <a href="[url]">[caption]</a>
@return string
Parse URLs from string