PHP Binary vs Decimal Number System

Notes:

Decimal Vs. Binary number system

Decimal Number System: (base=10)
0,1,2,3,4,5,6,7,8,9
Ex: 65, 15, 35, 40, 128 etc.

Binary Number System: (base =2)
0, 1
Ex: 01000001, 00001111, 00100011, 00101000, 10000000 etc.

Example Code:

echo decbin("65"); // 1000001
echo "<br/>";

echo decbin("15"); // 00001111
echo "<br/>";

echo decbin("35"); // 00100011
echo "<br/>";

echo decbin("40"); // 00101000
echo "<br/>";
echo "<br/>";

echo bindec("1000001"); // 65
echo "<br/>";

echo bindec("00001111"); // 15
echo "<br/>";

echo bindec("00100011"); // 35
echo "<br/>";

echo bindec("00101000"); // 40
echo "<br/>";

Interview Questions:

1. PHP stands for ______________
a. Hypertext Preprocessor
b. Preprocessor Hypertext
c. Personal Home Processor
d. Personal Hypertext processor
Ans: a