str_ireplace problems.
| From: | Daniel Spain | Date: | Tue, 01 Nov 2005 23:59:03 +0000 |
| Subject: | str_ireplace problems. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-224920@lists.php.net to get a copy of this message | ||
Greetings!
I'm writing a quick and dirty tool which converts directory paths into
internet friendly paths..
So converting this: C:\PHP
to this: file:\\server01\share\PHP
Everything else works, except this line of code.. Is there some
problem I'm overlooking? My PHP skills are limited to database
manipulation, so string functions other than nl2br are beyond me...
The code I'm using is:
//Remove the drive letter and replace it with a single slash
$step1 = str_ireplace("T:\\", "\\", $_POST['path']);
In context:
//Remove the drive letter and replace it with a single slash
$step1 = str_ireplace("T:\\", "\\", $_POST['path']);
$step2 = "file:\\\\server01\\staffpub".$step1;
$html = "<a href=\"".$step2staff."\">Staff</a><br
/>";
$result = htmlspecialchars($html);
--
Fare thee well,
Daniel "TheHeadSage" Spain
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
E-mail: theheadsage@gmail.com
Mob: +61 0407 057 580