Function that returns false if the number passed as argument contains digit ( s ) other than '0' or '1'
< ? php function isBinary ( $ n ) { while ( $ n != 0 ) { $ temp = $ n % 10 ; if ( $ temp != 0 && $ temp != 1 ) { return false ; } $ n = intval ( $ n / 10 ) ; } return true ; }