You are here: Re: addcslashes « PHP Programming Language « IT news, forums, messages
Re: addcslashes

Posted by Taras_96 on 02/08/07 07:24

> Next, I tried
>
> echo bin2hex(addcslashes("\0","\0")); which gave 5c 30 30 30, which is
> a backslash followed by 3 spaces. What's happening here? I would have
> thought that the output would be
>
> 5c 00 (backslash followed by a null)
>
> Taras

Meh, I re-read the manual more closely and realised that: "while other
non-alphanumeric characters with ASCII codes lower than 32 and higher
than 126 converted to octal representation."

so 5c 30 30 30 = \ octal representation of 0

or, if the byte x01 was escaped, the result would be

5c 30 30 31 = \001 = \ octal representation of 01

What is the point of converting to an octal representation? Where
would it be used? I've never heard of this being used in the c
language..

Taras

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация