Search found 6 matches

by chipTM
Sun Apr 30, 2006 1:04 am
Forum: PHP - Code
Topic: Stripping characters from a variable and pasting them with..
Replies: 8
Views: 424

if all you're replacing is the prefix to the path the '../..' then it won't matter... as I said in my first post, if the needle is going to change, you'll need to use preg_replace() and write a regular expression to do your replacement. I don't know if you can help me with this as well, and this mi...
by chipTM
Sun Apr 30, 2006 12:40 am
Forum: PHP - Code
Topic: Stripping characters from a variable and pasting them with..
Replies: 8
Views: 424

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] [quote=&q...
by chipTM
Sun Apr 30, 2006 12:29 am
Forum: PHP - Code
Topic: Stripping characters from a variable and pasting them with..
Replies: 8
Views: 424

if a simple replace of static data is what you're trying to do then str_replace() is the tool: ex: $domain = "http://www.mydomain.com"; $somevar = "../../somepath/somefile.wmv"; $newvar = str_replace("../..",$domain,$somevar); echo $newvar; Ok, so that is right on trac...
by chipTM
Sun Apr 30, 2006 12:07 am
Forum: PHP - Code
Topic: Stripping characters from a variable and pasting them with..
Replies: 8
Views: 424

not sure I fully understand what you're trying to accomplish...but I think str_replace() is what you're after. If the needle will be variable, then you should use preg_replace() . As a added note, I just looked at those functions you suggested, and I am afraid they will replace all instances, and I...
by chipTM
Sun Apr 30, 2006 12:04 am
Forum: PHP - Code
Topic: Stripping characters from a variable and pasting them with..
Replies: 8
Views: 424

not sure I fully understand what you're trying to accomplish...but I think str_replace() is what you're after. If the needle will be variable, then you should use preg_replace() . O wow, I have no idea what you just said, but I WILL go research it and try to figure it out on my own, as this is a ti...
by chipTM
Sat Apr 29, 2006 11:57 pm
Forum: PHP - Code
Topic: Stripping characters from a variable and pasting them with..
Replies: 8
Views: 424

Stripping characters from a variable and pasting them with..

static info.... ok, im a big time php newbie using a CMS... I want to take a variable called $url that always returns data in this form: "../../files/web/file.name" Ok, here is what I want to do with that. Basically I want to strip off the "../.." and put a "http://www.myser...