All pastes #93756 Raw Edit

Someone

public text v1 · immutable
#93756 ·published 2006-07-20 18:53 UTC
rendered paste body
function getBinary($temp){
	if(1 === $temp){
		return true;
	}
	if(0 === $temp){
		return false;
	}
	
	if(isEmptyOrNull($temp)){
		return;
	}
	
	if(
		$temp === true
		||
		strtoupper($temp) === 'YES'
		||
		strtoupper($temp) === '1'
		||
		strtoupper($temp) === 1
		||
		strtoupper($temp) === 'ACTIVE'
		||
		strtoupper($temp) === 'A'
		||
		strtoupper($temp) === 'ON'
		||
		strtoupper($temp) === 'DOG'
		||
		strtoupper($temp) === 'DAY'
		||
		strtoupper($temp) === 'SUN'
		||
		strtoupper($temp) === 'MEN'
		||
		strtoupper($temp) === 'MALE'
		||
		strtoupper($temp) === 'BOY'
		||
		strtoupper($temp) === 'LIGHT'
		||
		strtoupper($temp) === 'WHITE'
		||
		strtoupper($temp) === 'UP'
		||
		strtoupper($temp) === 'ALIVE'
	){
		return true;
	}elseif(
		$temp === false
		||
		strtoupper($temp) === 'NO'
		||
		strtoupper($temp) === '0'
		||
		strtoupper($temp) === 0
		||
		strtoupper($temp) === 'INACTIVE'
		||
		strtoupper($temp) === 'I'
		||
		strtoupper($temp) === 'OFF'
		||
		strtoupper($temp) === 'CAT'
		||
		strtoupper($temp) === 'NIGHT'
		||
		strtoupper($temp) === 'MOON'
		||
		strtoupper($temp) === 'DARK'
		||
		strtoupper($temp) === 'BLACK'
		||
		strtoupper($temp) === 'WOMEN'
		||
		strtoupper($temp) === 'FEMALE'
		||
		strtoupper($temp) === 'GIRL'
		||
		strtoupper($temp) === 'DOWN'
		||
		strtoupper($temp) === 'DEAD'
	){
		return false;
	}
	
	return;
}