I took a look at the str_replace function and it will work but I am getting
a weird thing happening now. When I do:
$filevalue = str_replace("\\", "/", $filevalue);
it is reversing the "\\" to "//" but not replacing them with just a single
What may be causing this?
"Kevin Stone" <kevinhelpelf.com> wrote in message
> ----- Original Message -----
> From: "Micah Montoy" <montmicaisu.edu>
> To: <php-generallists.php.net>
> Sent: Tuesday, July 08, 2003 4:01 PM
> Subject: [PHP] preg_replace - understanding
>> function> > I'm trying to understand how the code works within the preg_replace> > but the manual is just obscure as the examples are. Anyway, I amhow.> to> > use it to replace "\\" in a string with "/" and I can not figure how> the> > At first, I thought I could just do:
> > $filevalue = preg_replace("'\\', /", $filevalue);
> > but it doesn't do anything. If someone could relate what it is and what>> > parts mean between the (), I would appreciate it.
> > thanks
> You're not using the function correctly. You've got the search string and
> replace string tied up into one input there. They need to be separate.
> $filevalue = preg_replace('\\', '/', $filevalue);
> However you should consider using the str_replace() function in your case
> since you aren't doing any pattern matching and it's a lot faster than
> $filevalue = str_replace('\\'. '/', $filevalue);