RE: [PHP] Re:[PHP] \ Char Question
| From: | Matt Stone | Date: | Wed, 13 Dec 2000 04:54:23 +0000 |
| Subject: | RE: [PHP] Re:[PHP] \ Char Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30021@lists.php.net to get a copy of this message | ||
Ok, one more question:
What if I want to go back the other way? Say:
"/\\/\\" => "M" ?
But int he string it will be "/\/\" but if I try and detect this through
strtr then it returns parse error. If I do /\\/\\ then I dosnt detect it
because thr string only contains /\/\... any ideas?
Matt Stone
-----Original Message-----
From: Sam Masiello [mailto:smasiello@chekinc.com]
Sent: Wednesday, 13 December 2000 12:56 PM
To: Matt Stone
Cc: PHP List
Subject: [PHP] Re:[PHP] \ Char Question
Since the \ character means to take the next character literally, it is
likely having a problem with the fact that you have a backslash right before
your double quote mark. If you want a literal backslash, you need to use
two backslashes.
Try: $str = strtr($str, "m", "/\\/\\") ;
That should do what you are looking for.
HTH
Sam Masiello
System Analyst
Chek.Com
(716) 853-1362 x289
smasiello@chekinc.com
On Tue, Dec 12th 2000 19:59:04 Matt Stone <matt@planetveggie.com> wrote:
>Hi,
>I am trying this code:
>$str = strtr($str, "m", "/\/\");
>The problem is that I have an error from tying to echo the \ char. How
would
>I fix this?
>Thanks,
>
>Matt Stone
>
>_______________________________
>
>This email may contain confidential and/or privileged information for the
>sole use of the intended recipient. Any review or distribution by others is
>strictly prohibited. If you have received this email in error, please
>contact the sender and delete all copies. Opinions, conclusions or other
>information expressed or contained in this email are not given or endorsed
>by the sender unless otherwise affirmed independently by the sender.
>
>_________________________________
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net