acctman Posted November 1, 2008 Share Posted November 1, 2008 does anyone have an example code of how to strip a URL prior to sql insert. http:// , www. how would you strip domain.com though when the tld can be anything from .com - .me Quote Link to comment Share on other sites More sharing options...
alexweber15 Posted November 1, 2008 Share Posted November 1, 2008 you want to just store the parts in the middle of the url? www.phpfreaks.com would become phpfreaks ? its perfectly safe to replace special html entities, espace strings and just store the entire thing...either way if you search the forums there's tons of example and PHP also has a set of built in "filter" functions... Quote Link to comment Share on other sites More sharing options...
alexweber15 Posted November 1, 2008 Share Posted November 1, 2008 oh and if you meant the first option like just get rid of the start and end parts you can probably use string functions to locate the 'http://', 'www' and all occurences of '.' so you probably will just need to identify the limits and extract a substring (not as elegant as using preg_replace) Quote Link to comment 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.