Convert plain text URLs into HTML hyperlinks in PHP
Date : March 29 2020, 07:55 AM
like below fixes the issue Here is an other solution, This will catch all http/https/www and convert to clickable links. $url = '~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?<![\.,:])~i';
$string = preg_replace($url, '<a href="$0" target="_blank" title="$0">$0</a>', $string);
echo $string;
$url = '/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/';
$string= preg_replace($url, '<a href="$0" target="_blank" title="$0">$0</a>', $string);
echo $string;
$url = '@(http)?(s)?(://)?(([a-zA-Z])([-\w]+\.)+([^\s\.]+[^\s]*)+[^,.\s])@';
$string = preg_replace($url, '<a href="http$2://$4" target="_blank" title="$0">$0</a>', $string);
echo $string;
$url = '@(http(s)?)?(://)?(([a-zA-Z])([-\w]+\.)+([^\s\.]+[^\s]*)+[^,.\s])@';
$string = preg_replace($url, '<a href="http$2://$4" target="_blank" title="$0">$0</a>', $string);
echo $string;
$email = '<a href="mailto:email@email.com">email@email.com</a>';
$string = $email;
echo $string;
|
Convert plain text URLs to HTML hyperlinks in Ruby on Rails?
Date : March 29 2020, 07:55 AM
hope this fix your issue Rails 3 Use the provided helper method called auto_link, which is part of ActionPack. <%=h auto_link(@my_object.description) %>
require 'rails_autolink'
auto_link("Go to http://www.rubyonrails.org and say hello to david@loudthinking.com")
# => "Go to <a href=\"http://www.rubyonrails.org\">http://www.rubyonrails.org</a> and
# say hello to <a href=\"mailto:david@loudthinking.com\">david@loudthinking.com</a>"
|
convert plain text URLs to HTML hyperlinks in PHP
Date : March 29 2020, 07:55 AM
|
Convert a column of text URLs into active hyperlinks in Shiny
Date : March 29 2020, 07:55 AM
will help you I am creating a user interface for a pathway enrichment program. The results are shown in a table as shown below. , You need to do two things: mydata$url <- paste0("<a href='",mydata$url,"'>",mydata$url,"</a>")
|
Excel - How to automatically convert Text URL to active hyperlinks?
Tag : excel , By : hlpimfalling
Date : March 29 2020, 07:55 AM
wish help you to fix your issue I have an Excel file which needs to be sent to my colleagues. However, there is a column "link" which includes the text URL, the URL only can be activated when I double click this cell. How can I automatically activate these text URLs so my colleagues don't need to double click on each cell? , With inactive links in column A, in B2 (or some other column) enter: =HYPERLINK(A2,A2)
|