Question : conditional statement help. php

Chek this,
1:
2:
3:
4:
if(($_SESSION["type"]=='xn2')or($_SESSION["type"]=='xn3')or($_SESSION["type"]=='xn1')){
				
	}
	else{$drill.="disabled=disabled";}


actually what I want to happen is, if $_SESSION["type"] is not 'xn2' or if $_SESSION["type"] is not 'xn3' or if $_SESSION["type"] is not 'xn1'

do something, I tried != but it only worked with one, if I put more stuff by separating "or" it dsnt work.

Any idea?

Answer : conditional statement help. php

<?php
session_start();
$_SESSION['type'] = 'xn4';

if (!in_array($_SESSION['type'], array("xn2", "xn3", "xn1")))
{
   echo "do something";
}
else
{
   $drill.="disabled=disabled";
}
?>

Random Solutions  
 
programming4us programming4us