php, jeśli null, to 0

if ($var == null){
	// do something 
}
CoderHomie