Re: "\90" != chr(90)
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: "\90" != chr(90)

From: Mara Guida <maraguida@gmail.com>
Date: Wed Jan 04 2006 - 23:30:59 CET

yawnmoth wrote:
> Obviously, "\9" equals chr(9), but what would equal chr(90)? "\90"
> doesn't. Rather, "\90" seems to be equal to chr(9).chr(0). So what
> could I do to get chr(90) using escaped numbers?

You can't do it with numbers in base 10.
You can do it with numbers in base 8 or 16.

      http://www.php.net/manual/en/language.types.string.php

$s_b16 = "\x5a";
$s_b8 = "\132";
$s_90 = chr(90);
/* all these strings are equal */

$s_x90 = "\90";
$s_d90 = chr(9*16+0); /* chr(144) */
Received on Tue Jan 17 16:52:50 2006