Re: Re: str_ireplace problems. [Solved]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've solved the problem. Turns out it wasn't my fault, but the other
network admins...

He said he installed PHP 5.. Turns out that in his mind 5 = 4. So I
changed from str_ireplace to str_replace and it all works.

Thanks for the website though!

On 02/11/05, Gustavo Narea <gustavo@xxxxxxx> wrote:
> Daniel Spain wrote:
> > //Remove the drive letter and replace it with a single slash
> > $step1 = str_ireplace("T:\\", "\\", $_POST['path']);
>
> I would use:
> $step1 = ereg_replace(trim("^[:alpha:]"),"",$_POST['path']);
>
> This will remove the first letter of the string. You should use this,
> unless this letter is "T" forever. As far as I can see, this is for
> Windows, and the letter may change depending on the machine.
>
> On the other hand, you should verify that the user is sending you a
> right path.
>
> The instruction I suggested you is based on Regular Expressions. If you
> want to get more information about them, I suggest you:
> http://www.regular-expressions.info
>
> PS: If get_magic_quotes_gpc() returns true, you should use
> stripslashes() too:
> $step1 = ereg_replace(trim("^[:alpha:]"),"", stripslashes($_POST['path']));
>
> --
> Best regards,
>
> Gustavo Narea.
> PHP Documentation - Spanish Translation Team.
> Valencia, Venezuela.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Fare thee well,
Daniel "TheHeadSage" Spain
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
E-mail: theheadsage@xxxxxxxxx
Mob: +61 0407 057 580

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux