Can you help me to write a number in its binary notation in PHP code and Javascript.
158 is decimal, 0xFF is hexa, 0154 is octa but how is binary ?
I want to set a value in php and read it in Javascript :
PHP:
$error &= 1000 (here must be the binary notation)
$error &= 0010
Javascript :
if (error & 0010) {alert(1)}
Thank you very much, your help is appreciated.
Part of the answer is here, there seems to be nothing for PHP :
What's the prefix for binary in PHP?
Binary literals don’t exist in php. Binary manipulations are usually done in hex,
can be replaced with
Also, see this related post What's the prefix for binary in PHP?