Page 1 of 1

Mapped Drive Replacement

Posted: Fri Feb 13, 2004 4:02 am
by drummo
Hi,
I am wanting to know if anyone can help me with some code to change the mapped drive?
I have a variable "X:/Home Directory/Directory/........." and I need to change it to "H:/Home Directory/Directory/.......... "

Any help please. :?

Posted: Fri Feb 13, 2004 5:23 am
by Cruzado_Mainfrm
and I need to change it to "H:/Home Directory/Directory/"
if those are only strings... u could simply do this:

Code: Select all

<?php
$str1 = "X:/Home Directory/Directory/";
$str2 = $str1;
$str2{0} = 'H'; //if not, change $str2{0} to $str2{1}
?>
i think that's it

Posted: Fri Feb 13, 2004 2:41 pm
by drummo
What if I wanted to lose the "Home Directory" and have the string = "H:/Directory"?

Sorry, I am a newby novice.