scvinodkumar Posted December 2, 2010 Share Posted December 2, 2010 Hi i searched google and found this function (http://zenverse.net/php-function-to-auto-convert-url-into-hyperlink). Its working fine until the url is not within double quotes. For example, $string = 'I have some texts here and also links such as "http://www.youtube.com" , www.haha.com and lol@example.com. They are ready to be replaced.'; When i call the function it is converting haha.com and lol@example.com only, not youtube.com. Please help me to solve this issue.. Thanks... Quote Link to comment https://forums.phpfreaks.com/topic/220471-converting-text-url-to-link/ Share on other sites More sharing options...
.josh Posted December 2, 2010 Share Posted December 2, 2010 In that script there are some preg_replace_callback(...) calls, change all the ([\s>]) to (["\'\s>]) Quote Link to comment https://forums.phpfreaks.com/topic/220471-converting-text-url-to-link/#findComment-1142258 Share on other sites More sharing options...
scvinodkumar Posted December 3, 2010 Author Share Posted December 3, 2010 Thanks for your help. But its not working as per my example, but when i change double quote to single quote, it is converting to url. Could u please tell me how to rectify this problem? Quote Link to comment https://forums.phpfreaks.com/topic/220471-converting-text-url-to-link/#findComment-1142536 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.