473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

"\90" != chr(90)

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?

Jan 4 '06 #1
2 2129
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) */

Jan 4 '06 #2
On 4 Jan 2006 14:19:01 -0800, "yawnmoth" <te*******@yahoo.com> wrote:
Obviously, "\9" equals chr(9),
That's not obvious, in fact it shouldn't equal chr(9) unless I'm missing an
extra section in the string parsing rules. That's the literal string "\9"
(length 2, slash followed by nine).

andyh@server ~/public_html $ cat test.php
<?php
var_dump("\9");
?>
andyh@server ~/public_html $ php -q test.php
string(2) "\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?


\132

As with Perl, C and C++, you use octal in this type of escape sequence.

http://www.php.net/manual/en/language.types.string.php
(scroll down to table 11-1).

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Beznas | last post by:
Hi All; I'm trying to create an ASP function called CleanX that removes the punctuation and some characters like (*&^%$#@!<>?"}|{..) from a text string I came up with this but It...
1
by: Dario de Judicibus | last post by:
I wish to create two simple layouts by using only HTML, CSS and the minimum JavaScript as possible. Layouts should be "elastic"/"liquid" (no fixed widths and heights) and cross-browser enabled. ...
32
by: Indrid Colt | last post by:
Thank's for your help ! Indrid
11
by: Dario (drinking coffee in the office…) | last post by:
The following program int main(){printf("%.2f\n", 90.625);} what it must print out? I try it on several compiler/operating system and I obtaing different results. On some compilers it...
5
by: Dan C Douglas | last post by:
I have just installed VS.NET 2003 on my computer. I have a project that I have been developing on VS.NET 2002. I haven't upgraded this project to VS.NET 2003 yet and I am still developing it in...
3
by: Mark | last post by:
Hello, Recently I have not been able to open an asp.net page in MDE's web from designer. I recieve the following error: "The file failed to load in the web from designer. Please correct the...
4
by: google | last post by:
Hi Hope someone can help me with this - have been staring at this problem all day, and with the cold I've got, just don't seem to be able to figure it out! I've got two tables, here with some...
0
by: minapatel | last post by:
I have the following procedure CREATE OR REPLACE procedure FOL_PURGE_CASES as /* type "SET SERVEROUTPUT ON" in sqlplus to debug !! */ cursor all_cases is cursor all_cases is ...
16
by: Tantale | last post by:
I used this serviec to check my webpage http://www.jmrw.com/Abroad/Barcelone/index.htm Made with Dreamweaver 8. The result is 206 errors, most of them "end tag omitted, but OMITTAG NO was...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.