Forum Moderators: coopster

Message Too Old, No Replies

Parsing character chr(92) from keyboad

php

         

franco190453

4:51 am on Dec 25, 2009 (gmt 0)

10+ Year Member



I was doing this ->
Gave me error.
php will not parse character ( \ ) from keyboard
$apli = 'im.exe';
$servr = '-server [mail.example.com:8000';...]
$adj = '-attach c:\Apache\Apache2\htdocs\ComuServer\Adjuntos\' . $archivoxgh;
$comando = sprintf("%s %s %s", $apli, $adj, $servr,);
@system($comando, $salida);

Had to do it like this ->
and worked fine!.
$apli = 'im.exe';
$servr = '-server [mail.example.com:8000';...]
$adj = '-attach c:/Apache/Apache2/htdocs/ComuServer/Adjuntos/' . $archivoxgh;
$uno = array("/");
$dos = chr(92); //This is the ascii value for character " \ "
$adjunto = str_replace($uno, $dos, $adj);
$comando = sprintf("%s %s %s", $apli, $adjunto, $servr,);
@system($comando, $salida);

My question is, Why php will not parse character " \ " from keyboard but it will do it
when I use char(92) which is the same?
Your comments wil be appreciated!.
Regards
Franco

[edited by: dreamcatcher at 4:35 pm (utc) on Dec. 25, 2009]
[edit reason] use example.com, thanks. [/edit]

TheMadScientist

12:28 am on Jan 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



My guess is it's the reserved character status...

Did you try \\ to define the \ as a litteral character rather than an escaping character?