I am integrating a PHP application with an API that uses permissions in the form 0x00000008
, 0x20000000
etc., where each of them represents a given permission. Their API returned an integer. In PHP, how do I interpret something like 0x20000000
an integer so that I can use bitwise operators?
Another developer told me that he considers these numbers to be hexadecimal annotation, but googling that in PHP I find limited results. What numbers are these and how can I take a set of permissions integer
, and using bitwise operators to determine if the user can0x00000008
.
source
share