tHud Posted February 4, 2011 Share Posted February 4, 2011 Hello I would like to convert a database 'product title' field into an URL. The part that I am concerned about is the product title itself. Typically, it would look something like this... Something® FA and Something™ ABC or Blaster® Demand Valve Would it be acceptable to simply replace the spaces with underscores? Or should I be looking into removing the ™ and ® (and other characters)? In which case, ideally I would need... Something® FA and Something™ ABC = something_FA_and_something_ABC and Blaster® Demand Valve = blaster_demand_valve ...but I wouldn't have a clue how to capture all such oddities. Is there perhaps a function that 'helps' with this sort of thing? Or is it down to regular expressions only? Thanks for any help Link to comment https://forums.phpfreaks.com/topic/226724-converting-a-string-to-an-acceptable-url/ Share on other sites More sharing options...
Psycho Posted February 4, 2011 Share Posted February 4, 2011 urlencode() Link to comment https://forums.phpfreaks.com/topic/226724-converting-a-string-to-an-acceptable-url/#findComment-1170027 Share on other sites More sharing options...
Pikachu2000 Posted February 4, 2011 Share Posted February 4, 2011 urlencode Link to comment https://forums.phpfreaks.com/topic/226724-converting-a-string-to-an-acceptable-url/#findComment-1170029 Share on other sites More sharing options...
tHud Posted February 4, 2011 Author Share Posted February 4, 2011 Heh - thanks guys. I actually did consider that but I wasn't sure that the resulting word+word+word format was the 'right' way to do things. Thank you for confirming that. Link to comment https://forums.phpfreaks.com/topic/226724-converting-a-string-to-an-acceptable-url/#findComment-1170031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.