includes/Utils.php
/**
     * Parse given string and checks if it contains any valid URL, altered string
     * is returned with links for those URLs
     *
     * @param string $string
     * @return mixed
     */
Parse given string and checks if it contains any valid URL, altered string
is returned with links for those URLs

@param string $string
@return mixed
Parse given string and checks if it contains any valid URL altered string is returned with links for those URLs @param string $string @return mixed
public static function createLinks($string) {
        $urlPattern = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
        if (preg_match($urlPattern, $string, $url)) {
            $string = preg_replace($urlPattern, "<a target=\"_blank\" href=" . $url[0] . ">" . $url[0] . "</a> ",
                $string);
        }
        return $string;
    }
public static function createLinks ( $ string ) { $ urlPattern = " /(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/ " ; if ( preg_match ( $ urlPattern , $ string , $ url ) ) { $ string = preg_replace ( $ urlPattern , " <a target= \" _blank \"  href= " . $ url [ 0 ] . " > " . $ url [ 0 ] . " </a>  " , $ string ) ; } return $ string ; }
Parse given string and checks if it contains any valid URL, altered string
 is returned with links for those URLs
Parse given string and checks if it contains any valid URL altered string is returned with links for those URLs