View Single Post
  #2 (permalink)  
Old 06-11-2002, 11:46 PM
kpyew's Avatar
kpyew kpyew is offline
Senior Webmaster
 
Join Date: Jul 2001
Location: KL, Malaysia
Posts: 277
Rep Power: 96
kpyew is on a distinguished road
Send a message via ICQ to kpyew
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(loc1str" ")
    
    if (
loc1 > -1) and (loc2 > -1) and (loc1 loc2then
        url 
Mid(strloc1loc2-loc1)
        
first_part Mid(str1loc1-1)
        
second_part Mid(strloc2len(str))
    elseif(
loc1 > -1) and (loc1 len(str)) then
        loc2 
len(str)
        
        
url Mid(strloc1loc2-loc1+1)
        
first_part Mid(str1loc1-1)
        
second_part ""        
    
end if
    
    
response.write first_part "<a href=" url ">" url "</a>" second_part
%> 
__________________
webmaster @ http://kongtechnology.com
Reply With Quote