sav571 Posted August 18, 2006 Share Posted August 18, 2006 Hello,i have a variable like $link . $link example mms://mysite/video.wmvi want to remove mms (3charaters at the begining) of $link and add http.how can i do this? Link to comment https://forums.phpfreaks.com/topic/17942-delete-3-charaters-at-varibale-begining/ Share on other sites More sharing options...
craygo Posted August 18, 2006 Share Posted August 18, 2006 $link = "mms://mysite/video.wmv";$url = "http".substr($link, 3);echo $url;Ray Link to comment https://forums.phpfreaks.com/topic/17942-delete-3-charaters-at-varibale-begining/#findComment-76726 Share on other sites More sharing options...
AndyB Posted August 18, 2006 Share Posted August 18, 2006 or [url=http://ca.php.net/manual/en/function.str-replace.php]str-replace()[/url] Link to comment https://forums.phpfreaks.com/topic/17942-delete-3-charaters-at-varibale-begining/#findComment-76729 Share on other sites More sharing options...
ryanlwh Posted August 18, 2006 Share Posted August 18, 2006 yeah use str_replace Link to comment https://forums.phpfreaks.com/topic/17942-delete-3-charaters-at-varibale-begining/#findComment-76875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.