Mapped Drive Replacement

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
drummo
Forum Newbie
Posts: 5
Joined: Wed Jan 21, 2004 5:44 am

Mapped Drive Replacement

Post 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. :?
Cruzado_Mainfrm
Forum Contributor
Posts: 346
Joined: Sun Jun 15, 2003 11:22 pm
Location: Miami, FL

Post 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
drummo
Forum Newbie
Posts: 5
Joined: Wed Jan 21, 2004 5:44 am

Post by drummo »

What if I wanted to lose the "Home Directory" and have the string = "H:/Directory"?

Sorry, I am a newby novice.
Post Reply