ballhogjoni Posted August 7, 2007 Share Posted August 7, 2007 Is there a function that will strip a specif string from a string? I have a field in my form that asks for the url, I don't want to save the http://. example: $string = 'http://example.com'; $url = strip_string($string, 'http://'); Quote Link to comment https://forums.phpfreaks.com/topic/63754-solved-strip_string/ Share on other sites More sharing options...
GingerRobot Posted August 7, 2007 Share Posted August 7, 2007 Use str_replace with a blank replace parameter: <?php $str = 'http://example.com'; $url = str_replace('http://','',$str); echo $url; ?> Quote Link to comment https://forums.phpfreaks.com/topic/63754-solved-strip_string/#findComment-317715 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.