Program to convert KiloBytes to Bytes and Bits | Function to calculates the bits ; calculates Bits 1 kilobytes ( s ) = 8192 bits ; Function to calculates the bytes ; calculates Bytes 1 KB = 1024 bytes ; Driver code
< ? php function Bits ( $ kilobytes ) { $ Bits = 0 ; $ Bits = $ kilobytes * 8192 ; return $ Bits ; } function Bytes ( $ kilobytes ) { $ Bytes = 0 ; $ Bytes = $ kilobytes * 1024 ; return $ Bytes ; } $ kilobytes = 1 ; echo $ kilobytes ; echo ( " ▁ Kilobytes ▁ = ▁ " ) ; echo Bytes ( $ kilobytes ) ; echo ( " ▁ Bytes ▁ and ▁ " ) ; echo Bits ( $ kilobytes ) ; echo ( " ▁ Bits . " ) ; ? >