Jump to content


Photo

delete 3 charaters at varibale begining


  • Please log in to reply
3 replies to this topic

#1 sav571

sav571
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 18 August 2006 - 01:35 PM

Hello,
i have a variable like $link    . $link example  mms://mysite/video.wmv

i want to remove mms (3charaters at the begining)  of $link and add http.

how can i do this?

#2 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 18 August 2006 - 01:41 PM

$link = "mms://mysite/video.wmv";

$url = "http".substr($link, 3);
echo $url;

Ray

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 18 August 2006 - 01:44 PM

or str-replace()
Legend has it that reading the manual never killed anyone.
My site

#4 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 18 August 2006 - 05:56 PM

yeah use str_replace
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users