This is a quick hack for parsing url. You should be able to improve on this and come up with a function that does what you want... Share with us on your progress
Thanks.
PHP Code:
<%
str = "Here you are [url]http://kong.com[/url] ssss sss"
loc1 = InStr(str, "http://")
loc2 = InStr(loc1, str, " ")
if (loc1 > -1) and (loc2 > -1) and (loc1 < loc2) then
url = Mid(str, loc1, loc2-loc1)
first_part = Mid(str, 1, loc1-1)
second_part = Mid(str, loc2, len(str))
elseif(loc1 > -1) and (loc1 < len(str)) then
loc2 = len(str)
url = Mid(str, loc1, loc2-loc1+1)
first_part = Mid(str, 1, loc1-1)
second_part = ""
end if
response.write first_part & "<a href=" & url & ">" & url & "</a>" & second_part
%>