News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Cody Taylor's Blog:
Checking Bits With PHP
June 18, 2009 @ 11:12:43

Cody Taylor has a quick post to his blog about bit checking in PHP:

PHP makes life a lot easier for quick or dirty maintenance scripts, cron jobs or web applications but how does it do for older, not so straight forward problems dealing with bits and bytes? I was surprised how easy it was to manipulate bits in a byte with php. Here is an function that made my life a fair amount easier when having to check for a specific bit in a byte.

The function takes in the value and, after casting it to an int, checks to see how it compares to eight and returns it. This result can be passed through decbin function for output. A handy table of the bitwise operator definitions is also included.

0 comments voice your opinion now!
definition tutorial bit check


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Integrating Propel with the Zend Framework

NETTUTS.com: Using PayPalís Instant Payment Notification with PHP

Derick Rethans' Blog: MongoDB Cursors with PHP

DevShed: Working with Prepared Queries with PDO Objects in PHP 5

Till Klampaeckel's Blog: So you'd like to migrate from MySQL to CouchDB? - Part II


Community Events

Don't see your event here?
Let us know!


extension version interview framework release language opinion laravel5 podcast laravel library series introduction community php7 video unittest voicesoftheelephpant security api

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework