You are here: Re: [PHP] RE: How to make binary strings useful? « PHP « IT news, forums, messages
Re: [PHP] RE: How to make binary strings useful?

Posted by Richard Lynch on 10/04/30 11:07

Jerry Miller wrote:
> Here's the code (with the domain name removed)
> that doesn't work, "despite" the poor documentation
> of the variable types:
>
> <?
> $dir = "/home/<domain_name>/www/binary/";
> $dh = opendir ($dir);
> do
> {
> $file = readdir ($dh);
> }
> while (!strncmp ($file, ".", 1));
> $filename = sprintf ("%s%s", $dir, $file);
> $fh = fopen ($filename, "r");
> $cont = fread ($fh, 4);
> echo "file:<BR>";
> echo $filename;
> echo "<BR>cont:<BR>";
> printf ("%02x %02x %02x %02x", $cont{0}, $cont{1}, $cont{2},
> $cont{3});
> fclose ($fh);
> closedir ($dh);
> ?>
>
> Here's the output of "od -c glance_date" up to the fourth byte:
>
> 0000000 177 E L F
>
> All four bytes are non-zero!

http://us4.php.net/language.types.type-juggling

--
Like Music?
http://l-i-e.com/artists.htm

 

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

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