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://'); 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; ?> Link to comment https://forums.phpfreaks.com/topic/63754-solved-strip_string/#findComment-317715 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.